I\'m confused on need for braces after IF() expression. When using IF(){...}ELSE{...} I\'m used to using braces around both IF and ELSE blocks. But when I use no ELSE block it
The way if works is if (condition) stmt1;
; if you want more than 1 statement to be executed if the condition is true, you need to wrap them up with {}. I suspect when you say your code "works" with no braces, you mean it compiles, but the execution will be quite different than if you wrapped the 4 statements in {}. Recall that C doesn't give a fig about indentation.