You are on page 1of 18

Identifiers: Identifiers are nothing but

names of variables, functions, files, array,


pointer etc.
Example for variables:

Example for functions:


Example for files:
a.c, b.cpp, c.txt, d.docx, e.java, f.py,..

int a[10];  array example


int * p;  pointer example
Rules:
1. Name should have to start with
alphabet or underscore only [ _ ]
2. Numbers allowed but not at first
position.
3. No special char except underscore.
4. Spaces not allowed.
5. Keywords not allowed.
6. Identifiers are case sensitive. i.e. lower
and upper are different.
7. Duplicate names not allowed in same
function.
8. Name may contain up to 32 characters
and excess characters ignored by the
compiler.
int a; /* var declaration */
a = 100 ; /* initialization */

constants: Fixed values are called


constants. We can’t change a constant
value during program execution. Constant
value should be provided at the time of
declaration only. i.e. further initializations
not allowed.

Example:
Numerical constants:
const float pi=3.14;
const int id = 1234;
char constants:
const char name[ ]=”Ravi”;  string const
const char gender=’M’; char const
String:
A group of characters is called string.
It is a character array.
Eg: char name[10]=”Surya”;
It is alpha-numeric. i.e. it can store
alphabets, numbers and special characters
also.
Eg:
char movie[ ]=”Bahu Bali-2”;
char city[ ]=”Hyd-500016”;
char mail[ ]=”kishore1234@gmail.com”
Note:
1. One byte should be left for NULL Char [\0].
Eg: char city[]=”Hyd-1”;

You might also like