KEYWORDS AND IDENTIFIERS
a) After covering the fundamental alphabet, we can look at more noteworthy
elements of C.
b) The most evident of the language elements are keywords and identifiers; their
forms are identical (even though their meanings are different).
Keywords
a) C keeps a small set of keywords for its own use.
b) Keywords have standard predefined meaning. Keywords are also known as
reserved words and we cannot alter the meaning of keywords.
c) Keywords are specific reserved words in C each of which has a specific feature
associated with it.
d) Virtually all of the words which help us use the functionality of the C language are
included in the list of keywords. So you can imagine that the list of keywords is not
going to be a small one!
e) Keywords are basic building block for developing C programs. There are only 32
keywords in standard C and these keywords must be written in lowercase.
f) These keywords cannot be used as identifiers in the program — a common
restriction with modern languages.
g) Where users of Old C may be astonished is in the introduction of some new
keywords; if those names were used as identifiers in previous programs, then
the programs will have to be changed.
h) It will be easy to spot, because it will provoke your compiler into telling you
about invalid names for things.
i) Keywords are predefined, reserved words used in programming that have distinct
meanings to the compiler. Keywords are part of the syntax and they cannot be used as
an identifier.
j) Here is the list of keywords used in Standard C; you will notice that none of
them use upper-case letters.
auto double int struct
break else long switch
registe
case enum typedef
r
char extern return union
unsigne
const float short
d
continue for signed void
default goto sizeof volatile
do if static while
, The new keywords that are likely to amaze old programmers are: const, signed, void and
volatile (although void has been around for a while).
Eagle eyed readers may have noticed that some implementations of C used to use the
keywords entry, asm, and fortran. These are not part of the Standard, and few will
mourn them.
IDENTIFIERS
Identifiers are used as the general terminology for naming of variables, functions and
arrays. These are user defined names consisting of arbitrarily long sequence of letters
and digits with either a letter or the underscore(_) as a first character.
Identifier names must be different in spelling and case from any keywords. You cannot
use keywords as identifiers; they are reserved for special use. Once declared, you can
use the identifier in later program statements to refer to the associated value.
A special kind of identifier, called a statement label, can be used in goto statements.
In C programming, name given to variables, constants, functions, arrays and various
other user defined items are known as identifiers.
Identifier refers to name given to entities such as variables, functions,
structures etc. Identifier is the fancy term used to mean ‘name’. In C,
identifiers are used to refer to a number of things: we've already seen them
used to name variables and functions.
They are also used to give names to some things we haven't seen yet, amongst
which are labels and the ‘tags’ of structures, unions, and enums.
It can also be defined as a set of combinations of one or more letters or digits
used to define constants, variables, functions etc.
Identifiers are defined by user and user should try to give meaningful name
while using identifiers to increase the readability of program.
The rules for the construction of identifiers are simple: you may use the 52
upper and lower case alphabetic characters, the 10 digits and finally the
underscore ‘_’, which is considered to be an alphabetic character for this
purpose. The only restriction is the usual one; identifiers must start with an
alphabetic character.
a) After covering the fundamental alphabet, we can look at more noteworthy
elements of C.
b) The most evident of the language elements are keywords and identifiers; their
forms are identical (even though their meanings are different).
Keywords
a) C keeps a small set of keywords for its own use.
b) Keywords have standard predefined meaning. Keywords are also known as
reserved words and we cannot alter the meaning of keywords.
c) Keywords are specific reserved words in C each of which has a specific feature
associated with it.
d) Virtually all of the words which help us use the functionality of the C language are
included in the list of keywords. So you can imagine that the list of keywords is not
going to be a small one!
e) Keywords are basic building block for developing C programs. There are only 32
keywords in standard C and these keywords must be written in lowercase.
f) These keywords cannot be used as identifiers in the program — a common
restriction with modern languages.
g) Where users of Old C may be astonished is in the introduction of some new
keywords; if those names were used as identifiers in previous programs, then
the programs will have to be changed.
h) It will be easy to spot, because it will provoke your compiler into telling you
about invalid names for things.
i) Keywords are predefined, reserved words used in programming that have distinct
meanings to the compiler. Keywords are part of the syntax and they cannot be used as
an identifier.
j) Here is the list of keywords used in Standard C; you will notice that none of
them use upper-case letters.
auto double int struct
break else long switch
registe
case enum typedef
r
char extern return union
unsigne
const float short
d
continue for signed void
default goto sizeof volatile
do if static while
, The new keywords that are likely to amaze old programmers are: const, signed, void and
volatile (although void has been around for a while).
Eagle eyed readers may have noticed that some implementations of C used to use the
keywords entry, asm, and fortran. These are not part of the Standard, and few will
mourn them.
IDENTIFIERS
Identifiers are used as the general terminology for naming of variables, functions and
arrays. These are user defined names consisting of arbitrarily long sequence of letters
and digits with either a letter or the underscore(_) as a first character.
Identifier names must be different in spelling and case from any keywords. You cannot
use keywords as identifiers; they are reserved for special use. Once declared, you can
use the identifier in later program statements to refer to the associated value.
A special kind of identifier, called a statement label, can be used in goto statements.
In C programming, name given to variables, constants, functions, arrays and various
other user defined items are known as identifiers.
Identifier refers to name given to entities such as variables, functions,
structures etc. Identifier is the fancy term used to mean ‘name’. In C,
identifiers are used to refer to a number of things: we've already seen them
used to name variables and functions.
They are also used to give names to some things we haven't seen yet, amongst
which are labels and the ‘tags’ of structures, unions, and enums.
It can also be defined as a set of combinations of one or more letters or digits
used to define constants, variables, functions etc.
Identifiers are defined by user and user should try to give meaningful name
while using identifiers to increase the readability of program.
The rules for the construction of identifiers are simple: you may use the 52
upper and lower case alphabetic characters, the 10 digits and finally the
underscore ‘_’, which is considered to be an alphabetic character for this
purpose. The only restriction is the usual one; identifiers must start with an
alphabetic character.