only constructors take member initializers | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

only constructors take member initializers

void Set(int Data) : Dat(Data) {} Output: only constructors take member initializers

24th Aug 2017, 7:05 AM
Marek Küthe
Marek Küthe - avatar
1 Answer
0
You are using an initializer list (the thing that starts with a colon) on something that is not a constructor.
24th Aug 2017, 11:50 AM
marit vandijk