+ 1
Difference between class and structure in c++?
4 Réponses
+ 7
Key Difference: C++ is an object oriented language that mainly focuses on objects. A class in C++ can be defined as a collection of related variables and functions encapsulated in a single structure. Instances of the class are termed as objects. A structure in C++ can be referred to as an user defined data type possessing its own operations. Unlike in the C language, they both are quite similar in C++. The main difference that exists between them is regarding the access modifier; the members of a class are private by default, whereas members of a struct are public by default.
+ 1
yes datatyps ; if u use int in Class u need to use int only
- 1
Ok here is your answer ☺️
Members of Class are by default private. But
Members of structure are by default public.
That is the simplest difference