skip execution of some statements

Is there any way to enforce c++ compiler to skip some statements on the basis of a condition ?
For Example :

if(i>10)
{
//do not execute any printf statements inside this if block
}
Do you actually mean the compiler - the thing that turns your text source code into a program? Or do you mean that you want something to happen when the program is run?

1
2
3
4
if(i>10)
{
   printf ("Only show me if i is greater than ten");
} 
Last edited on
closed account (zb0S216C)
Obviously you don't understand control branching. A if block will only be executed if the condition is true. Otherwise, the block (or statement) following the condition is ignored.

Wazzak
Topic archived. No new replies allowed.