What is the difference between Class and Structure?
Answer Posted / navin
Structure: Initially (in C) a structure was used to bundle
different type of data types together to perform a
particular functionality. But C++ extended the structure to
contain functions also. The major difference is that all
declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all
the members inside the class are private.
| Is This Answer Correct ? | 182 Yes | 55 No |
Post New Answer View All Answers
What are the types of pointer?
Describe Trees using C++ with an example.
When does the c++ compiler create temporary variables?
What are the uses of c++ in the real world?
What is the benefit of learning c++?
What is a class template in c++?
What do nonglobal variables default to a) auto b) register c) static
Is java easier than c++?
Is c better than c++?
What is the use of cmath in c++?
How the endl and setw manipulator works?
What is abstraction with real time example?
What is abstract keyword in c++?
Is swift better than c++?
How come you find out if a linked-list is a cycle or not?