Struct in a Class

Started by
2 comments, last by mrtuti_17 20 years, 11 months ago
How would I implement a structure as a private member inside of a Class? Thanks, Justin
Advertisement
??

class A{public:  ...private:  struct B  {     ...  };}; 
class foo{public:     char c;private:     struct bar{          int a;          int b;     };} 


Within foo you can create instances of bar and use them normally, you just can''t use them outside of foo. Had bar been declared as public, you could declare stuff like foo::bar b;
Thanks everyone, that really helped.

-Justin

This topic is closed to new replies.

Advertisement