The code I have below at the moment outputs the letter H which is in position 0 but I want to know if there is a way to also output not just the letter H but also the pointer position of the letter H.
using namespace std;
const char* letterPointer = "Harry";
cout << letterPointer << endl
It's a common technique to cast to
void * from
char * for that purpose, as follows:
cout << static_cast<const void*>(&letterPointer) << endl;
By the way, in C++,
string does NOT mean
char *, but rather std::string.
So this include line is not necessary in your code.
#include <string> // You'd probably want to remove this line.