10.static_extern
生活随笔
收集整理的這篇文章主要介紹了
10.static_extern
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
- 另一個(gè)文件聲明 #include <iostream>
using namespace std;
int x = 10;void show()
{cout << "1234" << endl;
}
?
- 本文件使用 1 #include <iostream>
2 using namespace std;
3 //引用外部全局變量
4 extern int x;
5
6 //只能在當(dāng)前文件使用
7 static int x1 = 100;
8
9 void show();
10
11 void main()
12 {
13 cout << x << endl;
14 show();
15 cin.get();
16 }
?
轉(zhuǎn)載于:https://www.cnblogs.com/xiaochi/p/8543773.html
總結(jié)
以上是生活随笔為你收集整理的10.static_extern的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Datalogic得利捷扫码器助力生产与
- 下一篇: 浙江利捷分析报告(0607)