?? p1-45.txt
字號:
#include<iostream.h>
main()
{
//聲明變量和指針變量
int a,b,c,*ip;
//指針變量ip指向變量a
a=100;
ip=&a; //使指針變量 ip 指向變量a
cout<<"a="<<a<<endl;
cout<<"*ip="<<*ip<<endl;
cout<<"ip="<<ip<<endl;
//指針變量ip指向變量b
ip=&b; //使指針變量 ip 指向變量b
b=200;
cout<<"b="<<b<<endl;
cout<<"*ip="<<*ip<<endl;
cout<<"ip="<<ip<<endl;
//指針變量ip指向變量c
ip=&c; //使指針變量 ip 指向變量b
*ip=a+b;
cout<<"c="<<c<<endl;
cout<<"*ip="<<*ip<<endl;
cout<<"ip="<<ip<<endl;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -