[Solved] Identifier in C++ cannot be a keyword, can it? [closed]


Are these keywords identifiers?

No, keywords are not identifiers.

they gave me some keywords and tell me not to use them. What identifiers should I use then?

For identifiers you have to use arbitrary words that are not keywords.

It’s easier to explain with an example.
Consider this line:

int foo = 42;

Here, int is a keyword. This line makes foo an identifier.
However, this line:

int friend = 42;

would be ill-formed (i.e. wouldn’t compile), as it tries to make a keyword (friend) an identifier.

5

solved Identifier in C++ cannot be a keyword, can it? [closed]