C Keywords and Identifiers
C Keywords and Identifiers

C Keywords and Identifiers


Right now, we will find out about catchphrases; saved words in C programming that are a piece of the linguistic structure. Likewise, you will find out about identifiers and how to name them.

C Character set

A character set is a lot of letters in order, letters and some exceptional characters that are legitimate in C language.

Alphabets

Uppercase: A B C ................................... X Y Z

Lowercase: a b c ...................................... x y z

C accepts both lowercase and uppercase alphabets as variables and functions.

Digits

0 1 2 3 4 5 6 7 8 9

Special Characters

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


White space Characters

The characters that are invisible are called white spaces.


Example: Space bar, Enter key, the tab key, etc.


C Keywords/Reserved words


Keywords are the inbuilt words that have special meaning to the program and used for a different purpose.



int morning;


Here, int is a watchword that demonstrates cash is a variable of type int (whole number).


As C is a case delicate language, all catchphrases must be written in lowercase. Here is a rundown of all watchwords permitted in ANSI C.




There are 32 keywords in c language.

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


Every one of these catchphrases, linguistic structures, and applications will be examined in their individual themes. Be that as it may, in the event that you need a concise review of these catchphrases without going further, visit List of all keywords in C programming.

C Identifiers

An identifier is a name by which we can identify value, an Array, a function, etc.

Identifiers must be special. They are made to give a special name to a substance to distinguish it during the execution of the program. For instance:

  1. int ram;
  2. double sam;
Here, ram and sam are identifiers.


Restriction while giving the identifier name

1. Maximum 31 characters are allowed for a name, but it is better to use a maximum of 8 characters.

2. A name can't be started with a digit, but we can use digit after an alphabet.

example: a1, a9

3. No special characters are allowed for a name except underscore(_)

example: ab+
                 a_b✔️
                 _ab✔️

4. No keywords are allowed for a name.

You can choose any name as an identifier if you follow the above rule, however, give meaningful names to identifiers that add up.