Hello.
Goes through a reference. It will be more up-to-date and your function will remain in a void
This is nonsense. | string a = VoidFunction(); |
Same as if you wrote. | string a = ; |
@Arpit T and @Gerard Willia G J B M Dinh Sy :
I suggest you both read the documentation, and pay attention to William's post. Don't dismiss it.
Any function defined as "void", means that it has no return value. I repeat, no value is returned by a void function.
So, if you want a function to return a string, then declare it as returning a string and not as void.
string StringFunction() { return "I am string"; };
string a = StringFunction();
Another option is to pass the parameter by reference ...
void VoidFunction( string &sText ) { sText = "I am Void"; };
string a; VoidFunction( a ); Print( a ); // outputs "I am Void"
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 want to capture data from void function
a void function may have int, bool or double value but may not return anything
Is it possible?
If i try to capture
string a = VoidFunction();
It returns error expression of 'void' type is illegal