cout << (void *) test 什么意思?
#include <new>
using namespace std;
int main()
{
char total[512];
char* pd1 = new (total) char[2];
char* pd2 = new (total) char[2];
cout << "The address of total is " << &total << endl
<< "The address of pd1 is " << &pd1 << endl
<< "The address of pd2 is " << &pd2 << endl;
cout << "The other address of total is " << (void *) total << endl
<< "The other address of pd1 is " << (void *) pd1 << endl
<< "The other address of pd2 is " << (void *) pd2 << endl;
cin.get();
}
两个cout 显示的结果不相同,不明白void * 究竟是什么意思.