How to overload the "Print" function for print a custom object
You don't overload the Print function. Create methods inside the object and call them.
struct MyStruct { int a; int b; string as_string(){ return StringFormat("a = %i, b = %i", a,b); } void Print(){ ::Print(as_string()); } } // MyStruct ////////////////////////// obj.Print(); // It prints itself.
I created a custom struct
I want to print a object that is created from this struct
To do it easier I want to overload the Print function and just do like this:
As a result, I want to see this
How to overload the Print function for print a custom object?