Pointer can also be used to create strings. Pointer variables of char type are treated as string. Pointers are very useful in accessing character arrays. The character strings can be assigned with a character pointer.
char array[ ] = “Love India”; //array version
char *str = "Hello";
This creates a string and stores its address in the pointer variable str. The pointer str now points to the first character of the string "Hello". Another important thing to note that string created using char pointer can be assigned a value at runtime.
str = "hello"; //Legal
The content of the string can be printed using printf() and puts().
Notice that str is pointer to the string, it is also name of the string. Therefore we do not need to use indirection operator *.