C++??????/C++???????
???????????? ???????[ 2014/10/16 14:51:48 ] ????????C++ ??????? NET
????0??????
????????????C++??????????????????????????
?????????????????????????????????????????????????????????塣
??????????????????????????????????黮??????????????????????
????1???????????
?????????????????е?????????????????
??????????????????????????????????????????????????????????????????????λ???????????
????????????????????????????????????????????:
??????????????????????????/??????/???????????????
?????????????????÷???????:
????namespace_name::member_name
????2????????????
????(1)?????????????????????????????:??????Χ??λ???????????????????б?????(?????γ?????????????)??????????????????????塣
????(2)??????????????????????????????з?????????????幹?????????????????????????У??????????????????????????????
????????????????????????????У???????????С???????????????????????????С?
????(3)??????????????????????β??
????3???????????(Nested Namespce)
????3.1??????????????(ordinary nested namespace)
?????????????????????????????????????????????????????????С?
??????????????????е?????????????????
?????????????????????????::??????????::????????
?????????????????????????????
#include <iostream>
namespace MyOutNames
{
int iVal1 = 100;
int iVal2 = 200;
namespace MyInnerNames //?????????????
{
int iVal3 = 300;
int iVal4 = 400;
}
}
int main(void)
{
std::cout<<MyOutNames::iVal1<<std::endl;
std::cout<<MyOutNames::iVal2<<std::endl;
std::cout<<MyOutNames::MyInnerNames::iVal3<<std::endl; //??????????????
std::cout<<MyOutNames::MyInnerNames::iVal4<<std::endl; //??????????????
return 0;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11