Difference between Structure and Class in C++?

Answers were Sorted based on User's Feedback



Difference between Structure and Class in C++?..

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

Difference between Structure and Class in C++?..

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

Difference between Structure and Class in C++?..

Answer / ammukutty

give the clear full difference between structure and class

Is This Answer Correct ?    2 Yes 1 No

Difference between Structure and Class in C++?..

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

Difference between Structure and Class in C++?..

Answer / poooooooo

sexy and funny

Is This Answer Correct ?    13 Yes 58 No

Post New Answer

More STL Interview Questions

differentiate between private, public and protected data members of the class using example.

1 Answers  


if 4-5 year old brother is standing on d roof with me and watching d moon, suddenly moon coverd by cloud then how will i explain d hiding of moon to my brother.

8 Answers   MBT,


What is the STL?

2 Answers   Epson, HP,


What is stl language?

0 Answers  


Give two integer arrays A & B.A has n elements and B has ' n-1 ' elements . A has all the elements that are there in B. But B has one missing element. Write a function that takes arrays , A & B as imnput and finds the missing element in most optised manner .

4 Answers   Zycus Infotech,






How the STL's are implemented, What the difference between templates and STL?

1 Answers   Symphony,


What is stl in oop?

0 Answers  


Is string part of stl?

0 Answers  


How connect plc and pc through software

0 Answers  


tell about sorted linked list

1 Answers  


Write a program in C/C++ to implement reader- writer problem

1 Answers   Wipro,


Describe the My Computer and My Documents folders; identify the elements that are present in every Window.

0 Answers  


Categories