Monday, 15 April 2013

c++ - Expected unqualified-id before 'xor' token -



c++ - Expected unqualified-id before 'xor' token -

why g++ compiler says: error: expected unqualified-id before 'xor' token

class biginteger{ public: unsigned *array; biginteger xor(biginteger bi){ // g++ indicates error line biginteger n; if(bi.array == (unsigned*)0){ homecoming n; } homecoming n; } };

xor alternative token ^ in c++, can't utilize identifier. same or/bitor , and/bitand (||, |, && , & respectively), , few others. keywords if or for.

choose different name function.

full list of alternative tokens (c++ standard §2.12 keywords, see §2.6 alternative tokens mappings):

and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq

c++ compiler-errors g++

No comments:

Post a Comment