string literal in C++

A string literal has type "array of n const char". A string literal is not a std::string, but a const char[]. An array of n const char converts to a pointer to const char. char* is less cv-qualified than const char *, and the conversion is not allowed.
In C++,  '\0' is appended to every string literal so that programs that scan a string can find its end, so sizeof() a string is string length + 1. 
```
#include <iostream>
     
int main() {
    char *str = "X"; // ISO C++ forbids converting a string constant to ‘char*’
    std::cout << str;
}
```