As it can be done for integers and numerical data when a pointer is created and displayed like this
int number = 5;
int *numberaddress = &number;
cout << "The number is "<< *numberaddress << endl;
cout << "The address of number is "<< numberaddress << endl;
However when the same is done for string or constant string pointer it gives the string itself as below
char string[20] = "string";
char *stringaddress = string;
const char *stringcopy = "string";
cout << "The string is " << stringaddress << endl;
cout << "The address of string is " << *stringaddress << endl;
cout << "The stringcopy is " << stringcopy << endl;
How can I get the address of string by pointers and not just string, is there a way or there is a different method for it ?