What is the difference between Class and Structure?
Answer Posted / mohanraj.d
1.structure is a value type.but class is a reference type.
2.structure is stored in stack.but class is stored in heap.
3.struct cannot have default constructor.
4.struct do not support inheritance.
5.class can inherit from a class.
6.struct cannot have declare destructor.
7.class has define object and function.
8.structure has define only object.
Is This Answer Correct ? | 50 Yes | 28 No |
Post New Answer View All Answers
Which is better turbo c++ or dev c++?
What are advantages of c++?
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
Am studying basic c++ programming, have been given the following assignment. Design a linear program to calculate the maximum stress a material can withstand given a force and a diameter of a circle. To find the required area pi should be defined. Have most of the program sorted out but am at a loss as to how to show the calculations required. Can anyone help?
How do you write a function that can reverse a linked-list?
How do I get good at c++ programming?
What is vector pair in c++?
what do you mean by volatile variable?
What is the difference between prefix and postfix versions of operator++()?
Does c++ support multilevel and multiple inheritances?
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
What is a node class in c++?
Is c++ still being used?
Explain differences between new() and delete()?
What is ios flag in c++?