Color Blindness Test

Consider the following code:

Without colors:

And with colors:

it will print something useless

The problem here is with the line:

p points to x (=100), q points to y (=20) so it should print res=5 but the statement parses as a comment because the it has /*

The compiler ignore the comment and because there is another real comment the line after it parses the statement like this :

Another problem is the line :

p1 is not a pointer , when we declare:

we declare p as pointer to integer and p1 as an integer,¬†we don’t get any compiler error because it parsed here as multiply

Conclusion

Use colored editor for writing your code (forget about vi)