C??C++??const?÷????????
???????????? ???????[ 2015/4/29 16:15:41 ] ????????C++ ??????? ??
????2. ???????????const_cast????????????const?????????*p=3????????? ??p??????????????и?????????????????????????
1 #include<iostream>
2
3 using namespace std;
4
5 int main(int args ?? char argv[]) {
6
7 const int var = 10;
8 std::cout << "var =" << var << std::endl;
9 // int * p= &var; --??????????????
10 //?????????????const ????
11 int *p = const_cast<int *>(&var);
12 *p = 3;
13 std::cout << "*p =" << *p << std::endl;
14 std::cout << "var =" << var << std::endl;
15 int num[var];
16
17 int i = 0;
18 //?????
19 for (auto data : num) {
20 data =++i;
21 std::cout<<"num["<<i-1<<"] =" << data << std::endl;
22 }
23 getchar();
24 return 0;
25 }
???????
??????? ????????????var???????и?? ?????C++????????????C++?????????????????????? ??
???????????C++??λ??????????*p=3??var=10????????????????*P?????????????????????????????????????????д????????????????????????????????????var=10???????????????з????????
????3. ?????????????????? const ????????????????????趨???????? int const * p / const int *p (??????????????????????????)?????????? ???? int * const p ???????????const int * const p ;
????????????????? ??????£?
????int const *p -----??????????д???????????????????????????????????????
????int * const p -----??????д????????????????? ??????????????????????????????????????
????int const * const p ----???????д????????????????????????
?????????????趨??????????????????????????????????????power ?? ??????????????????????? ?? ????const??????????????ó? ??? ?????????????????????????????е???????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
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????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????