strings are stored in memory as array of characters with a null charactera te the end.in this statement
cout<<"hello";
is this string being stored in memory.please give an example of this situation other than
char name[10]="hello";
Each string literal is stored in memory and whether two equal string literals will be stored as one literal or as two separate literals it is implementation defined and depends of the compiler options. So in general the result of the following comparision can be false or true depending on your compiler and its option.
if ( "Hello" == "Hello" ) std::cout << "They occupy the same memory\n";
else std::cout << "They are stored separatly\n";