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

Is string part of stl?

0 Answers  


What is Template Specialization?

1 Answers   Lucent,


What are the symptoms of stl?

0 Answers  


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

0 Answers  


write a program to search and display the position of an element in a single-dimentional array using function.

1 Answers  






write a c++ to define a class box with length,breadth and height as data member and input value(),printvalue() and volume() as member functions.

3 Answers  


What is Object Oriental Progam

2 Answers  


what is electronic software

1 Answers  


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

0 Answers  


what's the difference between abstract class and concreate class? what's the meaning of standard template library(STL)?

2 Answers  


Difference between Structure and Class in C++?

5 Answers   Caritor,


What is a list in c++ stl?

0 Answers  


Categories