Trailing spaces after backslash delimiter – Programmers nightmare.
![]()
Usually we used to have spaces after semi columns. Since C++ ignore whitespace, its not a problem. But in Visual C++ 6.0 that is not the case always. If you put spaces after the backslash delimiter(\), it will become one of the worst bugs that you encounter.
![]()
Usually we use backslash delimiter to concatenate lines – mostly while writing macros. See the following macro.
#define INCREMENT_AND_DECREMENT( Value ) \
Value = Value + 1; \ » » »
Value = Value - 1;
In the macro, instead of » char, put some tab or space and then compile. You will get a strange error as follows.
error C2501: 'Value' : missing storage-class or type specifiers
![]()
One of the defensive mechanism is – always enable “View whitespace” by pressing Ctrl+Shift+8. So take care next time and don’t spend hrs on these silly bugs as I did years before.
![]()
Note that its just a implementation behavior in Visual C++ 6.0 and may not found in other compilers or upcoming Visual C++ versions.
Thanks to Hemant for pointing out my implicit biasing towards VisualStudio 6.0. I forgot to specify that its just a Visual studio behavior.

Targeted Audience – Intermediate.
This is the problem with VC++ compiler (VS 6.0 and VS 2005 )
I have tried the code on Dev-c++ ,gcc compiler
Indeed Hemant. You are right. Its just a Visual studio bug. But just now i’ve noticed that i didn’t mentioned that and instead I’ve written in context of C++. Thanks for pointing it out. I’ll correct it now.
Keep watching…
Regards,
Jijo.
If only I had a nickel for each time I came here… Great writing!
Thanks for those kind words, Melvin!
Best Regards,
Jijo.