There is no such difference between a C ++ struct and a C ++ class, you can perform almost all functions with a structure, as you can do with a class, but struct is the C keyword, which is gradually modified / developed in C ++ and is called class. And we are in C ++, it is better to use a class rather than a struct.
Let’s take an example if you have done some coding in C ++, and someone who works in Java came in 2 months to look at your code, and how convenient it is to understand the code using "struct" or code with "class"?
source share