7stud, your program example shows off what string literals are fairly well, just by analyzing the code.
To think about it further, consider this:
Code:
char *s = "Hello World!";
cout << s;
cout << "Hello World!";
As far as the compiler is concerned, you just passed the SAME pointer to the null terminated string "Hello World!" both times. In fact, the first statement initializes s to equal the pointer to whereever this string is stored - it does NOT allocate any memory for it. The memory for string literals is allocated and initialized at the start of the program, before any of your code is run. So, let's say that p points to the string literal "Hello World!", then:
Code:
char *s = "Hello World!";
char *s = p;
The above two lines produce the exact same results.