Just as every entity in the real world has a name, so you need to choose names for the things you will refer to in your programs. Programming languages use special symbols called identifiers to name such programming entities as variables, constants, and functions. Here are the rules for naming identifiers:1.
An identifier is a sequence of characters that consists of letters, digits, and under score (_).2.
An identifier must start with a letter or an underscore. It cannot start with a digit.3.
An identifier can not be a reversed word.4.
An identifier can be of any length, but your C++ compiler may impose some restriction. Use identifiers of 31 characters or fewer to ensure portability.For Example: area
are legal identifiers, whereas 2A
are illegal identifiers because they do not follow the rules. The compiler detects illegal identifiers and reports syntax errors.Note:
Since C++ is case sensitive, X
are different identifiers.