#include<stdlib.h>#include<iostream>using namespace std;namespace A{ int x=1; void fun() { cout<<"A"<<endl: }}? namespace B? {? ? ?int x=2; ?void fun() ?{ cout<<"B"<<endl;? }}int main(void){? ?cout<<A::x<<endl;? ?B::fun(); system("pause"); return 0;}
3 回答

慕仰2239611
TA貢獻2條經驗 獲得超0個贊
1> ?正在創建“Debug\test2.unsuccessfulbuild”,因為已指定“AlwaysCreate”。
1>ClCompile:
1> ?test.cpp
1>c:\users\administrator\desktop\test2\test.cpp(9): error C2143: 語法錯誤 : 缺少“;”(在“:”的前面)
1>c:\users\administrator\desktop\test2\test.cpp(9): error C2143: 語法錯誤 : 缺少“;”(在“:”的前面)
1>
1>生成失敗。
1>
1>已用時間 00:00:00.59
========== 生成: 成功 0 個,失敗 1 個,最新 0 個,跳過 0 個 ==========
- 3 回答
- 0 關注
- 1860 瀏覽
添加回答
舉報
0/150
提交
取消