+ 9
Is there a difference between class and struct?
explain your answer and Don't forget to upvote
3 Answers
+ 14
The main functional difference is that members of a structare public by default, while they are private by default in classes. Otherwise, as far as the language is concerned, they are equivalent.
Source - https://stackoverflow.com/questions/54585/when-should-you-use-a-class-vs-a-struct-in-c
+ 2
struct is your own type, like int or string, and what you could do:
struct friends
{
int tell number;
string name;
...others...
}
and use it : friends massive[2];
massive[0].name ="Anna";
So, the class - the pattern you can use to "build" same objects