C++ Code With "index" Variable Name CTEs on All Online Judges, But Not on PC

Revision en2, by vamaddur, 2017-11-22 07:52:02

When I name a variable "index" in my C++11 code, it successfully compiles with MinGW in CodeBlocks on my PC.

Picture Proof #1

However, on any online compiler/IDE (in this case, Ideone), I get a compile-time error.

Picture Proof #2

How can I make my compiler and/or IDE identify reserved words and prevent me from using them by accident?

I know it's a minor problem, and I could easily circumvent it by "misspelling" variable names (as I am doing now; e.g. prevy instead of prev), but I would still like to fix it.

Tags c++ compilers

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English vamaddur 2017-11-22 07:52:02 9 Tiny change: 'ex" in my online C++ code, it ' -> 'ex" in my C++11 code, it '
en1 English vamaddur 2017-11-22 07:51:36 681 Initial revision (published)