#include
using namespace std;
int main()
{
char ch1='I',ch2='Q';
int n1=1, n2=6;
double d1=1.25,d2=20.5;
char *a,*b;
a=&ch1;b=&ch2;
int *c,*d;
c=&n1;d=&n2;
double *e,*f;
e=&d1;f=&d2;
cout<<a<<" "<<b<<endl;
cout<<c<<" "<<d<<endl;
cout<<e<<" "<<f<<endl;
cout<<*a<<" "<<*b<<endl;
cout<<*c<<" "<<*d<<endl;
cout<<*e<<" "<<*f<<endl;
*a+=32; *b+=32;
*c-=5; *d-=5;
*e+=10.0;*f+=10.0;
cout<<*a<<" "<<*b<<endl;
cout<<*c<<" "<<*d<<endl;
cout<<*e<<" "<<*f<<endl;
return 0;
}
cout<<a 默認進行處理,輸出a所指向的字符串。
寫成這樣,cout<<(void *)a 因為void型, cout沒法輸出,只能乖乖輸出指針