Technical Discussion :: C++
Home > Freshers > Technical Interview Questions > C++
108. What is the difference between class and structure?
Answer:
1. Members of a class are private by default and members of struct are public by default.
2. 'struct' is the keyword for Structure and 'class' is the keyword for Class.
3. Structure is used for smaller amount of data and Class is used for larger amount of data.
4. Structure is usually as for grouping of data and Class is for inheritence and further abstraction.
Asked In :: Capgemini Virtusa Syntel Inc. Societe Generale
1. Members of a class are private by default and members of struct are public by default.
2. 'struct' is the keyword for Structure and 'class' is the keyword for Class.
3. Structure is used for smaller amount of data and Class is used for larger amount of data.
4. Structure is usually as for grouping of data and Class is for inheritence and further abstraction.