Identifiers in C

‘C ‘ Tokens:

In ‘C’ program the smallest individual units are called as tokens.
There are six types of tokens:
1. Identifiers.
2. Keywords
3. Constants
4. Strings
5. Operators

C’ character set: The ‘C’ character set denotes any alphabet, digit or special symbol used to represent information.
Following are the valid alphabets, numbers and special symbols allowed in C:

Alphabets                   A,B,………………………Z;a,b,……………………….z
Digits                           0,1,2,3,4,5,6,7,8,9
Special symbols         ! @ # % ^ & * ( ) _ – + = | \{ }, [ ], < > ” , ? / .

 

Identifiers:

A C identifier is a name used to identify a variable, function, or any other user-defined item.An identifier starts with a letter A to Z or a to z or an underscore _ followed by zero or more letters, underscores, and digits (0 to 9). C does not allow punctuation characters such as -, @, and % within identifiers. C is a case sensitive programming language. Thus, Demo and demo are two different identifiers in C.

Ex:Valid Identifiers: Foo _demo abc move_name a_123 myname50 _temp j a23b9 retVal
Invalid Identifiers: 1Demo a-123, demo@dss, a%b

Keywords:

Keywords are predefined tokens in C. These are also called as reserved words. Keywords have special meaning to
the C compiler. These words cannot be used for general purpose other than to which they are intended for.

auto break  Case  Char  Const  continue
default do  double  else  enum  extern
float for  goto  if  int  long
register return  short  signed  sizeof static
struct switch  typedef  union  unsigned void
volatile while

 

null

Mr. Sandeep Soni

Founder, Trainer & CEO, Deccansoft Software Services.

Sandeep has 21 yrs of experience working in various Microsoft Technologies/Platforms incl. VB6.0, ASP, VC++, VB.NET, C#. He is involved in managing and architecting projects at Deccansoft. He will be your liaison to Deccansoft, for any kind of communication and project updates. He knows what works and what doesn’t, and what practices are most suitable for design and programming with the ultimate goal of producing a quality system.