Introduction about String in C Language with Free Notes

Introduction – String

Each array illustrated so far has contained numeric elements. Arrays are not confined to numeric elements, however they may also consist of characters. In C, a string is stored internally as an array of characters. So a String is a group of characters of any length. A string enclosed within double quotation marks is known as a literal. For example, “Hello” is a literal. The strings can be stored and manipulated as array of characters in C. The last character in a string is always ‘\0’, null character with ASCII value equal to 0. Thus the effective size of an array of characters is one more than the size of string it can hold. For example, the string “COMPUTER” can be stored in an array (say item) as shown below.

The string requires total 9 Locations of Array item: eight for the alphabets in the string COMPUTER and one for the null character.

Free Hand-Written Notes

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top