Hi Gaurev,
and is a C++ keyword.
I strongly recommend avoiding keywords as variable names.
>I don't understand why the g++ versions are not backward compatible.
GCC C++ implementation strives to be compliant with the C++ standard (ISO 14882).
In situations when having to decide between backwards compatibility and C++ compliance, the backwards compatibility will (usually) be deprecated giving developers time to transition their code from the feature that has been earmarked for removal. At some point in time, the feature may be removed.
Much more rarely (in my experience) with GCC, a non-compliant feature (wart?) is changed without forewarning.
HTH. --Eljay