O'Reilly logo

C Programming by Ashok Kamthane

Stay ahead with the world's most comprehensive technology and business learning platform.

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

Start Free Trial

No credit card required

7

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.

Start Free Trial

No credit card required