1.

Solve : c++ user defined types question?

Answer»

I made a vector2D CLASS with a "double magnitude;" data member. I also have some functions that TAKE double as arguments. Is there any way I can put a vector2D object as an argument to these functions INSTEAD of "vector2D.magnitude"? If so, does it work only if magnitude is PUBLIC or does it also work as private?make the structure public in the same namespace as the class but not in the same class. I believe you can simply PLACE the definition immediately before the class definition.



Discussion

No Comment Found