I'm studying pointer and got confused with c_str() function.
The description says it returns a constant Null terminated pointer to the character array and when i try to print the variable, it doesn't print the address of it.
int main() {
string a = "hello";
const char* b = a.c_str();
cout << b << endl; //hello
}
I expected the output to be the address of b but instead it prints "hello".
Can someone explain why?