Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
14 / 187
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 ::
Varun Kumar Rai
13 Oct, 2019 1:07 PM
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.