CHARACTER STRINGS IN C!

Internally, each memory location of the above string holds an ASCII equivalent of the respective character. The null character (a byte with value zero) is placed at the end of the string.
String constants are always enclosed in double quotes as follows:
“Hello, World!”
Strings are used for conveying message to the user during I/O operation. For e.g., the statement
Printf(“Enter an ASCII code (0 – 127):”);
will prompt the user to enter an ASCII value by displaying the string “Enter an ASCII code (0 – 127):” on the screen. Strings are also used for storing and manipulating textual data containing words and sentences.
Declaring String Variables
A string variable is declared as one dimensional array of characters as follows:
char array-name[size];
where, size is an integer that specifies the length of the string. The maximum length of the string is always one less than the size (size-1), because one storage location must be reserved for storing the end of the string character. For instance,
char title[50];
declares an array named title with 50 memory locations. But, the maximum number of characters that can be stored in this array is 49, because the last character should be an end-of-string character.
Another way of declaring a string is using character pointer. A pointer can be considered as an alternative to an array, because the name of the array itself is a pointer to the first location of the array. The following example illustrates this:
char * title;
title = “C Programming”;
The above lines of code will declare a pointer variable of type char that points to the string “C Programming”, which is stored in memory using consecutive memory locations. The pointer title points at the first character of the string, and it reads up to the end of the string for retrieving the string.
The input and output operations with strings through pointers can be done as follows:
char * title;
scanf(“%s”, title);
printf(“%s”, title);
Initializing Strings
Strings can be initialized either at the time of declaration or after it. Initialization at the time of its declaration can be done in two ways. In the first method, initialize the value character-by-character. This is done using the following syntax:
char array-name[size] = {list of values separated by comma};
For instance, the statement:
char month[] = {‘A’, ‘p’, ‘r’, ‘i’, ‘l’, 0};
defines the string variable month and assigns to it the string “April.”. The actual size of the string is 6. Because, the last character is 0 (zero), which indicates the end of the string and it occupies the last position of the character array. The end-of-string can also be marked with the character ‘\0’. The end-of-string character must be given explicitly when the initialization is done character by character.
In the second method, a string constant is used for initializing the sting. In this method of initialization, we don't need to specify the dimension as well as the null character explicitly. The dimension as well as the end of string characters are assigned implicitly. Consider the following example:
char month[] = “April”;
At the time of compilation, the compiler takes care of separating and storing the characters individually in memory, and assigns the NULL character at the end.
sir u have really done a grt job by accumulating all these stuffs...its a complete package..thankyou sir