What is wrong in that code
#6

when you dont put brackets after an if, that if will only affect the next line

Код:
if (a == 1)
    command1;
command2;
command 2 will allways be executed
if u make use of this, please use tabs accordingly

anyway i suggest to allways put brackets, even if there is only one command after the if, because it's confusing and it can cause problems when you want to add something to it and you dont remember to put the brackets after that.
especialy if your compiler outputs shows you 300 warnings about "loosing identication" allready
Reply


Messages In This Thread
What is wrong in that code - by boyan96 - 26.04.2012, 18:49
Re: What is wrong in that code - by Elysian` - 26.04.2012, 18:51
Re: What is wrong in that code - by ViniBorn - 26.04.2012, 18:53
Re: What is wrong in that code - by Elysian` - 26.04.2012, 19:12
Re: What is wrong in that code - by [KHK]Khalid - 26.04.2012, 19:52
Re: What is wrong in that code - by Falco-Ger - 26.04.2012, 22:23

Forum Jump:


Users browsing this thread: 1 Guest(s)