+ 2
Declare a structure in a class
How can I declare a structure in an implementation of a function in a class??
1 Réponse
0
you would create the struct outside of the class. then declare an object of that struct as a member of the class
struct mstruct {...}
class mclass {
private:
int num;
mstruct obj;
...}
you could create an array of them as well. you could also just make the struct a class lol. that would be called aggregation, such that one class is made up of other classes.
hope this helps