/*
如下code,指定指標位址為0x64000000,
記得要型態轉換 (long unsigned int *),
而將unsigned long int m,assign 為指標位址時,
請加上const來轉換型態。
*/ #include
#include
using namespace std;
int main(int argc, char *argv[])
{
unsigned long int *p;
unsigned long int m, n, q;
p = &q;
m = (const long unsigned int)p;
cout << hex << m << endl;
m = 0x64000000ul;
p = (long unsigned int *) m;
n = (const long unsigned int)p;
cout << hex << n <
system("PAUSE");
return EXIT_SUCCESS;
}
沒有留言:
張貼留言