C++ ????t???????????????
???????????? ???????[ 2015/3/20 15:14:54 ] ????????C++ ???? ????? ???????
?????Ь??????C++????????????????鱾?????????м????????????????????????????????Ρ????????????????????????static??????????????????????????????????????????????????????????????????????????? ?????????????????????????????????????
[code=C/C++]
#include "stdafx.h"
int _tmain(int argc?? _TCHAR* argv[])
{
int initNum = 3;
for (int i=5; i > 0; --i)
{
static int n1 = initNum;
n1++;
printf("%d
"?? n1);
}
getchar();
return 0;
}
[/code]
????????????
????4
????5
????6
????7
????8
????????????????????????????????5?Σ????????n1????????????Ρ??????????????????????????????Щ?????
[code=C/C++]
int _tmain(int argc?? _TCHAR* argv[])
{
int initNum = 3;
for (int i=5; i > 0; --i)
{
static int n1 = initNum;
//???????????????????
int* p = &n1;
p++;
*p = 0;
//end
n1++;
printf("%d
"?? n1);
}
getchar();
return 0;
}
[/code]
????????????
????4
????4
????4
????4
????4
??????Σ?????????????????5?????????????5?Ρ?????????????????????????????????????????????????????????32λ???λ???????????????????????????????????????????p++;*p = 0;???ζ???????????0??????????????n1????б??????????????ζ????????Ρ????????棬?????????
????0x00E8716C 03 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 b0 e7 1e 6a 00 00 00
??????????????????????n1?????????3?????滹?????1??????????????????????????t?????????????????λ????????????????????????????????????????????????????
?????Ь???????????£?????????????????λ???????????????????????£???λ?????????????????????????
??????????????????????????????????????int initNum = 3;???????????static int n1 = 3;?????????????????????????????????????????????????????3???????????????????????????????????????????????
??????
???·???
??????????????????
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