C++, Programmimg Languages

IDENTIFIERS

Identifiers refer to the names of variables, functions arrays, classes, etc, created by the programmer. And there are also some pre-defined identifiers used in any language. They are the fundamental requirements of any language. Each language has its own rules for naming these identifiers.
Rules for writing an identifier name
• Only alphabetic characters, digits and underscores are acceptable.
• The name cannot start with a digit it must start with an alphabet or an underscore.
• Uppercase and Lowercase letters are different.
• A Keyword cannot be used as a variable name.

The following identifier names are valid:

Student_name, StudentName, student_name, student1, _student

The following identifier names are not valid:

Student name(due to space), Name&Rollno (due to special character &) ,1stName (starting with a digit), For (Being a Keyword) .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s