Variables after the colon in a constructor [duplicate]

It’s a way of invoking the constructors of members of the point3 class. if x,y, and z are floats, then this is just a more efficient way of writing this

point3( float X, float Y, float Z):
{
   x = X;
   y = Y;
   z = Z;
}

But if x, y & z are classes, then this is the only way to pass parameters into their constructors

Leave a Comment