This is the code
#include <iostream>
int main(){
const char* message{"Hello world."};
std::cout << "message : " << message << std::endl;
//*message = 'B'; //compiler error
std::cout << "*message : " << *message << std::endl;
//Allow users to modify the string
const char message1[]{"Hello world"};
message1[0] = 'B';
return 0;
}
I don't really see any difference between them and in which situation one or the other can be apply.
Lasty, How do we print out the address of pointer initialized with string?