You are right in that they are pointers. However, whether they are pointing to different locations or not depends on the implementation. It is perfectly valid for a compiler to store a string literal just once and use its address wherever it’s used in code.
More Related Contents:
- How to assign string pointer value to elements of a vector using loops in C++
- Pointer to string with spaces [closed]
- How to return a std::string.c_str()
- What makes more sense – char* string or char *string? [duplicate]
- Why does streaming a char pointer to cout not print an address?
- Modifying a char *const string
- Function stoi not declared
- How can a char pointer be initialized with a string (Array of characters) but an int pointer not with an array of integer? [duplicate]
- Assign a string literal to a char* [duplicate]
- Why do i have a random result on this template?
- pointer to string concept in c [closed]
- cannot convert ‘std::string’ to ‘char**’ for argument ‘1’ to ‘__ssize_t getline(char**, size_t*, FILE*)’
- How do I use arrays in C++?
- What is the difference between const int*, const int * const, and int const *?
- Will std::string always be null-terminated in C++11?
- Returning arrays from a function in c++
- stringstream, string, and char* conversion confusion
- How to reverse an std::string? [duplicate]
- Are there any better methods to do permutation of string?
- How do I replace all instances of a string with another string?
- C++ Remove punctuation from String
- Can I Allocate a specific memory address using pointers in c++?
- C++ function to count all the words in a string
- Why doesn’t std::string provide implicit conversion to char*?
- Convert double to string C++? [duplicate]
- In C/C++, is char* arrayName[][] a pointer to a pointer to a pointer OR a pointer to a pointer?
- Function returning array but main showing garbage [duplicate]
- dereferencing a pointer when passing by reference
- C++ most efficient way to convert string to int (faster than atoi)
- How do I include the string header?