I want to know the behaviour of break statement in C. Does it work only for ';for-while-do-switch' o

Posted by avanish on Stack Overflow See other posts from Stack Overflow or by avanish
Published on 2010-04-02T08:08:48Z Indexed on 2010/04/02 8:13 UTC
Read the original article Hit count: 153

Filed under:
|

Suppose, I have a 'if statement' inside a 'for-loop'.

for( ; ; ) {

-------

if( ) { printf(" inside if"); break; }//if

printf("inside for"); }//for

now, will the 'break-statement' cause the compiler to come out of the 'for-loop' or will it only come out of the if loop on the 'if-condition' being satisfied.

© Stack Overflow or respective owner

Related posts about learning

Related posts about c