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
Why do we need runtime polymorphism in c++?
Describe the syntax of single inheritance in C++?
Comment on c++ standard exceptions?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?
What is a dynamic binding in c++?
What are disadvantages of pointers?
Explain linear search.
What problems might the following macro bring to the application?
Will a catch statement catch a derived exception if it is looking for the base class?
What are the rules for naming an identifier?
Is there any function that can skip certain number of characters present in the input stream?
What does it mean to declare a destructor as static?
Is c++ pass by reference or value?
If I is an integer variable, which is faster ++i or i++?
Give example of a pure virtual function in c++?