String Operations and Standard Functions

CHAPTER OUTLINE

7.1 DEFINITION OF STRING

String is defined as an array of characters. In the text, we find words and sentences and they are normally controlled by strings. Every string is terminated with ‘\0’(NULL)character.

An example of a string is as follows:

char name[ ]={‘I’,‘N’,‘D’,‘I’,‘A’,‘\0’};

In C, each character of the string occupies 1 byte of memory. The last character is always ‘\0’. It is not compulsory to write ‘\0’ in a string. The compiler automatically puts ‘\0’ at the end of a character array or string. The characters of string ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.