Parts of C language

Estudies4you

C language parts


Identifiers:
In "C" programming, identifiers are the names given to 'c' entities, such as variables, functions, labels etc.
Identifiers are created to give a unique name to 'C' entities to identify them during the execution of the program.
Example:
int money;
int mango_tree;
Here, money is an identifier which denotes a variable of type 'integer'.
Similarly, mango_tree is another identifier, which denotes another variable of type integer.

Rules for writing identifiers
The first character in an identifier must be a letter or an underscore and can be followed only by any number of letters, or digits or underscores.
It should not begin with a digit. For example "2iname" is invalid.
Upper-case and lower-case letters are distinct. That is, identifiers are case sensitive.
Commas or blank spaces are not allowed within an identifier. Keywords cannot be used as an identifier.
System's name that start with an underscore are '_fileno', '_iob' etc.
Identifiers should not be more than 31 characters in length. Identifiers must be meaningful, short, quickly and easily typed and easily read.

Examples of valid and invalid names:
Valid Names:
0 //Valid but poor style
student_name
_aSystemName
_Bool //Boolean System id
INT MIN //System defined value

Invalid Names:
$sum //$is illegal
2names //First char digit
sum-sal //Contain hyphen
stdnt Nmbr //Contain Spaces
int //keyword


To Top