1.

What are the strings?

Answer»

Strings: Like a group of integers can be stored in an integer array, similarly a group of characters can be stored in a character array. Strings are single-dimensional arrays of type char. In ‘C’ , a string is terminated by null character or ‘\0’. String constants are written in double-quotes.

For Example: **char name [ ] = {‘I’ , ‘N’ , ‘D’ , ‘T’ , ‘A’ , ‘\0’};

Each character in the array occupies one byte of memory and the last character is always ‘\0’.’\0′ is called null character. Note that ‘\0’ and ‘0’ are not the same. ASCII value of ‘\0’ is 0, whereas the ASCII value of ‘O’ is 48. Many string functions such as string length, string compare, string copy, string concatenate etc. are most commonly used functions.



Discussion

No Comment Found