I do hope you made that pointer point to something before you wrote to the location it points to.
std::cout interprets passing pointers to char, and only pointers to chars, as the intention to print the C string they point to. If you need to print the actual address, cast the pointer to anything. void *, for instance.
i wrote this program to reverse a string and as you see i used pointers here , but the program still doesn't work ?? can you help me i have seen that pointer str didn't point to the first char but it points to all the string while swap points to the last character int the string and when compiler reach to this line *(swap-i)=*(str+i);
the program return a run time error