Introduction :
In the c language the group of characters,digits and symbols enclosed with in quotation marks are called as string.The string is always declared as character arrays.In other words character array are called as strings.To manipulate text such as words and sentences normally strings are used.Every string is terminated with '\0' (NULL) character is a byte with all bits at logical zero.Hence ,its decimal value is zero.For example :
char name [ ]={'I','N','D','I','A','\0'};
Each character of the string can be occupies 1 bytes of memory. The last character is always '\0'.It is not compulsory to write '\0' in string.The compiler automatically puts '\0' at the end of the character array or string.The character of string are stored in contiguous ( neighboring ) memory locations.
The below table shows the storing of the string elements in continuous memory locations.
Memory map of string
|
I
|
N
|
D
|
I
|
A
|
\0
|