int main()
{
int a = 1;
void* b;
int c;
b = (void *)&a;
c = *((int *)b);
std::cout << "value of c: " << c << std::endl;
return 0;
}
非指针数据通过void *指针转换
最新推荐文章于 2021-07-28 01:17:31 发布
int main()
{
int a = 1;
void* b;
int c;
b = (void *)&a;
c = *((int *)b);
std::cout << "value of c: " << c << std::endl;
return 0;
}