What is the difference between Class and Structure?
Answer Posted / nikhil jain
Structures are value types; classes are reference types.
Structures use stack allocation; classes use heap
allocation.
A structure must have at least one nonshared variable or
event member; a
class can be completely empty.
| Is This Answer Correct ? | 4 Yes | 9 No |
Post New Answer View All Answers
What is the difference between the indirection operator and the address of oper-ator?
How do I download c++?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?
what is data encapsulation in C++?
What is c++ prototype?
What are the vectors in c++?
Difference between delete and free.
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.
Explain the static member function.
When do you call copy constructors?
What is the main use of c++?
What are the advantages of c++ over c?
Can user-defined object be declared as static data member of another class?