2 ms·
I do the same in C++: myClass::myClass(int aa,int bb) : a(aa) , b(bb) , p(new int[aa]) , c(17) {} Yes, that looks weird at
by Someone 14y ago
I do the same in C++:
myClass::myClass(int aa,int bb)
: a(aa)
, b(bb)
, p(new int[aa])
, c(17)
{}
Yes, that looks weird at first, but you get used to it (and, to be honest, everything in C looks weird at first).