How come when using the string object for variables and parameters you need to have #include <string>, but you don't need it for string literals? For example, you can say cout << "This is a string literal"; without #include <string>.
I am learning C++ using a Deitel Brothers book and came up with this question when learning character arrays.
operator <<forstd::ostream&andconst char *(which, btw, can sometimes rear unexpectedly).strings. They are constant arrays of characters.std::coutis designed to print arrays of characters as strings.