c?????
???????????? ???????[ 2017/1/22 10:22:34 ] ????????C???? ???
???????????????????????????????洢???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????1.????????
??????????????????????????????????????????????μ?????????????????????磺int *ptr;//?????????int*??int**ptr??//?????????int**
????2.?????????????
??????????????????????????????е??????????????????????????*??????μ????????????????????磺int *ptr??//???????????????int??int**ptr??//???????????????int*??
????3.?????--???????????????????????
????????????????洢?????????????????????????????????????????????????????32λ???????????????????????????32λ?????????32λ????????????????32λ????
????4.????????????????
??????32λ??????????????4??????????
?????????????????????????????????????????????????????????????岻????????????λ???
?????????????????????????????????????????????????????????????????????????
????????????
????char *str[3]={
????"Hello??this is a sample!"??
????"Hi??good morning"??
????"Hello??world"
????};
?????????У?str???????????????飬?????????????????????????Щ????????????????????????????str?????????????????????????0????????????????char**??????????????char*??
????*str???????????????????char*????????????????char?????????????????“Hello??this is a sample??”?????????????????H??????????????????????????飬????????????????????棬??????????????????鳣?????????????????????????????????????????????????????????????
????str+1?????????????????????????????????????char**??????????????char*??
????*??str+1?????????????????????char*????????????????char???????“Hi??good morning??”?????????H??
??????????????????????????????
???????????????TYPE array[n]????????????array??????????壺
??????????????????????飬??????????TYPE[n]?????????????????????????????????TYPE*?????????????????TYPE????????鵥???????????????????????????????0????????????????е????????????????????????0???????????????????????????????????????????array++????????????
?????塢????????????
????????
????struct MyStruct
????{
????int a;
????int b;
????int c;
????};
????struct MyStruct ss={20??30??40}; //???????????ss??????ss??????????20??30??40.
????struct MyStruct *ptr=&ss; //?????????????????ss???????????????MyStruct
????int *pstr=(int *)&ss; //?????????????????ss?????????pstr??????????????ptr???????
??????????????????ptr??????ss???????????????
????????
????ptr->a; //??????????????(*ptr).a
????ptr->b;
????ptr->c;
????????????????????pstr??????ss???????????????
????????
????*pstr; //????ss????a
????*(pstr+1); //????ss????b
????*(pstr+2); //????ss????c
????????У????е?C/C++?????????????????????????????????鵥????????????洢?????棬????????????п?????????????????????????????????????????????????????????????????????????????????????????????“??????”?????????????????????????????????
????????????????????
?????????????????????????????????
????int fun1(char *??int);
????int (*pfun1)(char *??int);
????pfun1=fun1;
????int a=(*pfun1)("abcdefg"??7); //????????????ú???????????????????????βΣ??????????????У????????????????????Ρ?
?????????????????
????????
????char s='a';
????int *ptr;
????ptr=(int *)&s;
????*ptr=1298;
???????ptr?????int *????????????????????int????????????s??????????32λ?????У?s????????int???????????????????????????s?????????????????s??????????????????????????????????????????????б?????????????д????????????????????????????????洢???????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????????????????????????????????????
?????????????????????ptr1=??TYPE *??ptr2?У????sizeof??ptr2???????????sizeof??ptr1????????????????????ptr1??????ptr2??????洢?????????????sizeof??ptr2???????С??sizeof??ptr1????????????????????ptr1??????ptr2??????洢????????????
??????
???·???
??????????????????
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