#include<iostream>
using namespace std;
int main(){
int i;
char *p="hello world";
cout<<p;
i = reinterpret_cast<int>(p);
cout<<i;
return 0;
}
この行がcharのポインタ型であるpをint型にキャストし、のちにint型であるiへ代入するということはわかりますが(私がこう理解しているだけで、もうすでに間違えていた場合ごしてきください ><) )なぜそうするのにストレートにcharのポインタ型 *pを()内に記述,右のように記述しないのですか? i = reinterpret_cast<int>(*p);