C++ varialbes pass as struct and store in class
struct SDefinition{int a;int b;int c;};
1)
class CTv{int a;int b; int c; CTv(const SDefinition & def)
: a(def.a), b(def.b), c(def.c){}};
2)
class CTv{SDefinition m_Def;CTv(const SDefinition & def): m_Def(def){}};
what to prefer use 1 or 2? please provide arguments
No comments:
Post a Comment