If I had a simple class with two variables x and y and the ToString () function, which returns a formatted data string. When i call
cout << simpleClass << "\n";
Does anyone know a way that I could have simpleClass.ToString is automatically called to return a correctly formatted string? I suppose there is a way to do this using operator functions, but I don't know how to do this.
source
share