Strings

3 February 20120 comments

Introduction:

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.This string can be stored and manipulated as array of  characters in C.The last character in a string is always '\0' a null character with ASCII value equal to 0.Thus the effective size of the  array of characters is one more the the size of string it can hold.For example , the string "ALLCOMPILER" can be stored in an array as shown below.

                                                      
0  1  2  3  4  5  6  7 8 9 10  11
A L L C O M P I L E R \0


This string requires total 11 locations of array item:10 for the alphabets in the string ALLCOMPILER and one for the null character.

More About Strings

Declaration and Initialization
Standard library Functions
Passing strings to functions
Share this article :

Post a Comment

 
Copyright © 2011. All Compiler - All Rights Reserved