10.static_extern
生活随笔
收集整理的這篇文章主要介紹了
10.static_extern
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
- 另一個文件聲明 #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 //只能在當前文件使用
7 static int x1 = 100;
8
9 void show();
10
11 void main()
12 {
13 cout << x << endl;
14 show();
15 cin.get();
16 }
?
轉載于:https://www.cnblogs.com/xiaochi/p/8543773.html
總結
以上是生活随笔為你收集整理的10.static_extern的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Datalogic得利捷扫码器助力生产与
- 下一篇: 浙江利捷分析报告(0607)