Home »
Programming Tips & Tricks »
C - Tips & Tricks
C comments within a statement
By: IncludeHelp, on 07 FEB 2017
I have discussed about the comments, we can put a comments anywhere in the program by using comment characters /*...*/
But, do you know? We can also put a comment within the statement by using the same comment characters.
Consider the following statement
if(a>=b && a!=0)
printf("some statement.\n");
If we do not want to check a!=0, we can put this expression with && operator in the comment, like this:
if(a>=b /*&& a!=0*/)
printf("some statement.\n");
Now, program will check only a>=b.