What is the difference between struct and class?



What is the difference between struct and class?..

Answer / hrpynux@gmail.com

Structs are value type whereas Classes are reference type. Structs are stored on the stack whereas Classes are stored on the heap. Value types hold their value in memory where they are declared, but reference type holds a reference to an object memory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Which ide is best for c++?

0 Answers  


What is an opaque pointer?

1 Answers  


what is the use of Namespace in c++.

3 Answers  


What is Virtual Inheritance?

7 Answers   Amazon, Wipro,


What is the advantage of c++ over c?

0 Answers  






Define a conversion constructor?

0 Answers  


What is searching?

0 Answers  


Can you sort a set c++?

0 Answers  


structure that describe a hotel with name, address,rooms and number of rooms

2 Answers  


explain the reference variable in c++?

0 Answers  


What is the error in the code below and how should it be corrected?

0 Answers  


What are the unique features of C++.

0 Answers  


Categories