I am very new to C / C ++ and do not know what this method is called. But thatโs why Iโm trying to find the answer here. let me show you an example
MyClass::MyClass() : valueOne(1), valueTwo(2)
{
}
Where valueOne and valueTwo are class properties that are assigned values โโoutside the body, which method is called, and why it is done this way. Why not do it like this.
MyClass::MyClass()
{
valueOne = 1;
valueTwo = 2
//code
}
If anyone can help me, it will be great.
source
share