8.08.2011

C Fundamentals:Character Set & Identifiers

 A character is a symbol,digit or alphabet that represent information.These followings valid letters, digits and special characters are allowed in C.

A-Z(uppercase)

a-z(lowercase)
0-9(digits)
Certain special characters :
     + - * / = % & # ! ? ^ “ ‘ ~ @ $
     \ | < > ( ) [ ] { } : ; . , _ (blank space)
Identifiers: Identifiers are names given to various program elements,such as variables functions and arrays. 


Rules for Identifiers:It consists of letters and digits in any order except that the first character must be a letter.Both uppercase and lowercase letters are permitted.The underscore is also permitted and may be used as the first character of the identifier.Use of others are illegal.



Some valid identifiers:
    x                      y12                       sum_1          _temperature
 names              area                      tax_rate               TABLE
Some invalid identifiers:
     4th           “x”          order-no         error flag

0 comments:

Post a Comment