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.
One more difference apart from public and private access specifier, that struct don’t have protected as an access specifier while class do.
2. What is the difference between an object and a class?
Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.
A Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class don’t change.
The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed.
An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed.Also during that lifetime, the attributes of the object may undergo significant change.
3. What is encapsulation?
Encapsulation means wrapping up of Data and Code…this is what i got from data structures book.
4. What is an enumerator?
Enumeration is a value data type, which means that enumeration contains its own values and cannot inherit or pass inheritance. Enumerator allows you to assign symbolic names or integral constants.
5. What is the difference between c & c++?
There are many differences between c and c++ but some of the important are
1.A small but potentially important difference between c and c++ is that in c a character constant is automatically elevated to and integer whereas in c++ it is not.
2.In c we can declare the global variable several times eventhough it is a bad programming concept but in c++ it is an error.
3.Another subtle difference between c and c++ is that in c++ all functions must be prototyped.Remember in c prototypes are recommended but technically optional.















