When I name a variable "index" in my C++11 code, it successfully compiles with MinGW in CodeBlocks on my PC.
However, on any online compiler/IDE (in this case, Ideone), I get a compile-time error.
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.
Auto comment: topic has been updated by vamaddur (previous revision, new revision, compare).
see https://linux.die.net/man/3/index .
#define index index________
probably some library in the header is using the same variable/function name, just define the name as some random garbage at the start of the code
i clicked on this post expecting to comment the same thing again but i discovered me from 8 months ago already did the job
There was similar problem with
read
variable: http://codeforces.net/blog/entry/46466Simply no
using namespace std;