Thursday, November 23, 2017

Identifies and Keywords

Any C program only allow us to use Alphabets, Digits and Special characters. C is a Case Sensitive language. That means in c programming A is not similar to a. One is uppercase letter and another is lowercase letter.



Uppercase
A B C D E F G H I
J K L M N O P Q R
S T U V W X Y Z


Lowercase
a b c d e f g h l
j k l m n o p q r
s t u v w x y z


Digits
0 1 2 3 4 5 6 7 8 9


Special Character
# , < > . | ( ) ; $
: % ' ^ - [ ] - ? &
{ } " " / \ * _ +


What is identifier ? In general, by which we identify anything is an identifier (like my name is an identifier). In C programming an identifier is a name used to identify any user defined item like variable, function. Probably you are thinking what is variable ? let it go now, we will discuss it in the next topic/variables section.


  • An identifier can have both uppercase and lowercase letters, digits and underscores.
  • First character of an identifier should be an alphabet or underscore. We can’t use any digit in beginning of an identifier.
  • We can’t use special character in identifier except underscore.
  • An identifier can’t be any keyword. (we will discuss about keyword here).


In C programming some words are already been used in compiler. Keywords are part of the syntax. That’s why keywords are reserved. We can’t use those word as an identifier. If we can remember our basic c programming code then there we used return which is a keyword. We can’t use return as a identifier.

The following list shows the keyword or simply reserve word in C language.

Reserve Words (Keywords)
auto else long switch break case char const continue
default do double struct typedef union int if goto
for float extern return enum register short signed sizeof
static unsigned void volatile while _Packed


Previous Topic

Next Topic



No comments:

Post a Comment