Can anyone tell me what ":" this symbol used for | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone tell me what ":" this symbol used for

public: // Constructor with member initializer.. MyClass(int h, int d, std::string n, std::string w) : health(h), damage(d), name(n), weapon(w) {}

2nd Apr 2021, 1:06 AM
Nitin Bisht
Nitin Bisht - avatar
1 Answer
+ 5
member initializer list..there is a lesson for this
2nd Apr 2021, 1:14 AM
durian
durian - avatar