#include<iostream>
using namespace std;
int main()
{
int i = 0x7fff;
long s = static_cast<long>(i);
cout << s << endl;
i = s;
cout << i << endl;;
void* p = &i;
cout << p << endl;
float* m = (float*)p;
cout << m << endl;
m = static_cast<float*> (p);
cout << m << endl;
cout << static_cast<float> (*p) << endl;
//void 类型指针不能参与非指针类型转换?
return 0;
}
想知道这报错的原因是什么呀,真的是不能参与非指针类型转换吗?