0
Do not understand, what are the quotes on line 5 and 6 on this example?
class MyClass { public: MyClass(int a, int b) : regVar(a), constVar(b) { } private: int regVar; const int constVar; };
3 odpowiedzi
+ 8
if you mean { and } then those are beginning and the end of constructor. you must have those, even if your constructor doesnt contain any code, like in this case.
btw they are not called quotes in english, not sure how they are called
+ 3
@gordie
thank you
+ 3
@boskojevtic
@Gordie
thank you)