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.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?