10??C++??????????????
???????????? ???????[ 2015/1/5 11:16:38 ] ????????C++ net
?????????????????????????????????????????
char *c[] = {"ENTER"??"NEW"??"POINT"??"FIRST"};
char **cp[] = { c + 3 ?? c + 2 ?? c + 1 ?? c};
char ***cpp = cp;
int main(void)
{
printf("%s"??**++cpp);
printf("%s"??*--*++cpp+3);
printf("%s"??*cpp[-2]+3);
printf("%s
"??cpp[-1][-1]+1);
return 0;
}
|
????????
#include <stdio.h>
struct data
{
int a;
unsigned short b;
};
int main(void)
{
data mData;
mData.b = 0x0102;
char *pData = (char *)&mData;
printf("%d %d"?? sizeof(pData)?? (int)(*(pData + 4)));
return 0;
}
|
???????string?????????
#include <iostream>
#include <string>
using namespace std;
void chg_str(string str) {
str = "ichgit";
}
int main() {
string s = "sarrr";
chg_str(s);
printf("%s
"?? s.c_str());
cout << s << endl;
return 0;
}
|
????????????????
#include <stdio.h>
int sum(int a) {
int c = 0;
static int b = 3; // ???????
c++;
b += 2;
return (a + b + c);
}
int main() {
int i;
int a = 2;
for(i = 0; i < 5; ++i) {
printf("%d
"?? sum(a));
}
return 0;
}
|
???????????const???ε?????
?????????????????д??????????
????int GetInt(void)
????const int GetInt(void)
?????????????????????A ???????????????????
????A GetA(void)
????const A GetA(void)
?????????????????????
???????o???????32 bit??foo(2^31-3)??????
????int foo(int x)
????{
????return x&-x;
????}
????A??0 B: 1 C: 2 D: 4
????????C
?????????????????????????????????^????????????η???
??????????????
????unsigned char i=0x80;
????printf("0x%x
"?? ~i>>3+1);
???????????
?????????0xfffffff7???????+???????????>>??
??????
???·???
??????????????????
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