Actually you have stumbled upon an important difference between C and C++, the way structures are implemented.

In C, structures contains can contain only primitive and composite datatypes, whereas C++ structures gives more functionality, since the structures in C++ are similar to classes than structures in C, hence they provide additional functionality such as

Ability to classify members as private,public or protected.

Can contain member functions.

Structures in C++, can be used as a tool to enforce object oriented methods, since all OO functionality like inheritance, which is applicable to classes , holds good for structures as well.