分类: C/C++
2008-05-06 17:58:41
#include <cstdio> #include <iostream> using std::cout; int main() { int data = 65; int *d; d = &data; char *p; //p = &data;//这句编译不通过 p = (char*)&data;
printf("%d %d %d", &data, d, p); printf("\n%d %c\n", *d, *p); cout << *d << " " << p << "\n";//上下两句输出相同 return 0; }