double d = 43.56;
int m = d;
cout<<(char *)&m<<endl; //works fine, it prints: + = 43
cout<<(char *)m<<endl; //this doesn't work, char can't be made into a pointer
cout<<reinterpret_cast<char *>(&m)<<endl; //works fine, prints: +
cout<<static_cast<char *>(&m)<<endl; //Does not work
My question is, why the last line of code doesn't work?
Compiler error message: invalid static_cast from int* to type char*
Shouldn't static_cast be able to convert this?
Thanks in advance.