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

What does std :: flush do?

0 Answers  


Who invented turbo c++?

0 Answers  


What do you know about near, far and huge pointer?

0 Answers  


What is #include iomanip?

0 Answers  


Differentiate between declaration and definition in C++?

1 Answers  






Can you pass an array to a function in c++?

0 Answers  


Define 'std'.

0 Answers  


Can we declare destructor as static? Explain?

3 Answers  


i want the NIC programmer-B model papaer pattren, iwant the all model papers?

15 Answers   NIC,


What is conversion constructor?

2 Answers   TCS,


Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work

0 Answers  


What is a try block?

0 Answers  


Categories