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; };

2nd Dec 2017, 6:28 PM
Lobanov Evgeniy
Lobanov Evgeniy - avatar
3 Antworten
+ 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
2nd Dec 2017, 6:46 PM
boskojevtic
boskojevtic - avatar
+ 3
@gordie thank you
2nd Dec 2017, 9:15 PM
boskojevtic
boskojevtic - avatar
+ 3
@boskojevtic @Gordie thank you)
2nd Dec 2017, 9:45 PM
Lobanov Evgeniy
Lobanov Evgeniy - avatar