Errors, bugs, questions - page 1644
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
Did you come to us from the distant past? )
Compile error: ')' - not all control paths return a value
Well, frankly speaking, this is an absurd example. Even if C++ allows it, but is this case possible in a real application? Why would you put a loop there if there is only one iteration?
Why one, if in the sense it is an endless cycle and it is written to continue
And sometimes you need one, can you guess when? I'll give you a hint - to get out of a complicated if-else-switch like goto without unnecessary flags and other excesses
Why one, if it is an endless cycle and continues
And there are times when you need one, can you guess when?
In general, it's not very clear what exactly is meant by "under many lines with return, continue, without break". is there an if?
p.s. Got it.
In his example, all of them. An exit from while(true) is possible only through break operator (which it doesn't have) or return.
I'm not going to argue. But the compiler error message ')' - not all control paths return a value, it says the opposite.
What is the inverse of that? That it's not only possible to exit with a break or return? ))
In general, it's not very clear what exactly is meant by "under many lines c return, continue, no break". is there an if?
It doesn't matter. Playable even with an empty cycle:
//')' - not all control paths return a value Temp Script.mq4 25 1
About the opposite of what? That it's not only possible to exit with a break or return? ))
That's what it's about.
Not all code branches return a value. .....
I mean that not all the branches in the code above return a value. It is in such cases that the compiler generates this error.
This is about that.
That not all branches of the above code return a value. It is in such cases that the compiler generates this error.
It doesn't matter. Playable even with an empty cycle:
That's what I'm saying, the error message is wrong.
He didn't give the full code, and apparently that full code has branching operators.