I assume that you are talking about C ++, since there is no concept of “class” in C, although you can certainly have a struct as a member of another struct .
In addition to one minor detail, class and struct identical, and both are often called "class types". Everything that you can do with class (for example, with a member of a class type) can also be done with struct .
If you're interested, the only difference is the default accessibility for members and base classes; public for struct and private for class .
Mike seymour
source share