Professional Documents
Culture Documents
19-7-23 Identifiers and Constants in C
19-7-23 Identifiers and Constants in C
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”;