Difference between Structure and Class in C++?
Answers were Sorted based on User's Feedback
Answer / ashish raghuvanshi
Basically in C++ structure and class are same but with some
minor diffrences listed below:-
1. In classes all the members by default are private but in
structure members are public by default.
2. There is no term like constructor and destructor for
structs, but for class compiler creates default if you
don't provide.
| Is This Answer Correct ? | 79 Yes | 14 No |
Answer / madhusudhan
1. In classes all the members by default are private but in
structure members are public by default.
2. There is no term like constructor and destructor for
structs, but for class compiler creates default if you
don't provide.
3. Sizeof empty structure is 0 Bytes wer as Sizeof empty
class is 1 Byte
| Is This Answer Correct ? | 24 Yes | 20 No |
Answer / ammukutty
give the clear full difference between structure and class
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / alok
no. we can use the concept of constructor and destruct in c++ structure. one difference is that in c structure and c++ class is structure automatically initialization with zero.
| Is This Answer Correct ? | 2 Yes | 8 No |
What are the components of stl?
Why should a c++ programmer be interested in stl?
Describe the My Computer and My Documents folders; identify the elements that are present in every Window.
Explain stl.
#define CUBE(x) (x*x*x) main() { int a,b=3; a=cube(b++); printf("%d %d",a,b); } What should be the value of a and b? My calc a=4 but syst a=6 how pls tell me if you know it?
draw a flowchart that accepts two numbers and checks if the first is divisible by the second.
Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.
Write a program in C++ returning starting locations of a substring using pointers
sir please send me bpcl previous question papers
0 Answers BPCL Bharat Petroleum,
What is 2*2?
What is Constructor
What do stl stand for?