[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 93
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
Both are correct, but the second is quicker. The first always checks all conditions, the second does not check all conditions. And it's better to write it like this, so as not to confuse with else's affiliation:
Or put curly braces around the blocks at once.
Both are correct, but the second is quicker. The first always checks all conditions, the second does not check all conditions. And it's better to write it like this, so as not to confuse with belonging else:
Or put curly braces around the blocks at once.
Both are correct
Right, now let's speculate about what happens when cond_1, cond_2, cond_3 are not mutually exclusive...
I'm not arguing, the codes give different results in general. But if the conditions don't overlap, the results seem to be the same.
It may be easier to skip through swith(), if you don't need to calculate conditions...
In switch the value at case should be int, not always cond_ is int. I was honestly interested in the logic itself, which entry is better/faster.
In switch the value at case must be int, not always cond_ is int. I was honestly interested in the logic itself, which entry is better/faster.
The second one, but there is a restriction on nesting.
It is better to use case, if there is such a possibility.