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
Does std endl flush?
Explain shallow copy?
How to get the current position of the file pointer?
Is c++ a good beginners programming language?
Explain how the virtual base class is different from the conventional base classes of the opps.
Write about the members that a derived class can add?
How do you flush std cout?
How is new() different from malloc()?
What is setf in c++?
How would perform Pattern Matching in C++?
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
Write a struct time where integer m, h, s are its members?
What do you mean by “this” pointer?
Write a program to find the reverse Fibonacci series starting from N.
What is a template in c++?