????????????? Quora ???????????????? ????linux???2???????г???????
????Andrew Weimholt ????:
????switch????е?case ???????????if-else?????????????
switch (a)
{
case 1:;
// ...
if (b==2)
{
case 2:;
// ...
}
else case 3:
{
// ...
for (b=0;b<10;b++)
{
case 5:;
// ...
}
}
break;
case 4:
????Brian Bi ??????
????1. ??????????????
??????????????????????????????????“????????”???????????????????????????????????????????????????????????????????????á????磺
????int *p;
????/* *p??int?????? ???p?????int???????? */
????int a[5];
????/* a[0]?? ...?? a[4] ??int?????? ???a??int????????? */
????int *ap[5];
????/* *ap[0]?? ..?? *ap[4] ??int?????? ???ap????????int??????????????? */
????int (*pa)[5];
????/* (*pa)[0]?? ...?? (*pa)[4] ??int?????? ???pa????????int???????????? */
??????????????????: Brian Bi’s answer to C (programming language): Why doesn’t C use better notation for pointers?
????2. ??????????
??????C99???????????????????????塣??C99???????????????
????struct Foo {
????int x;
????int y;
????int z;
????};
????Foo foo = {.z = 3?? .x = 5};
??????δ?????????????foo.z???????????foo.x. foo.y ??б????????????????0??
??????????????????????????С????????д?????????
????int a[5] = {[1] = 2?? [4] = 5};
????int a[] = {[1] = 2?? [4] = 5};
????int a[5] = {0?? 2?? 0?? 0?? 5};
????3. ???????C99????
????restrict??????????????????????????????????????????????????????????????????κ???????????????棬?????????????????磬??
????int f(const int* restrict x?? int* y) {
????(*y)++;
????int z = *x;
????(*y)--;
????return z;
????}
?????????????????裬x??y ??????????????int?????????????????????????????x????????????y??????????????????????????????????????????f???????????????д????????????
????int f(const int* restrict x?? int* y) {
????return *x;
????}
?????????Υ??Э????f?????????????int?????????????????δ?????????
??????????????????????????????????C??????????????????Fortran???????Fortran ?У?????????鯔??????????????????restrict ???????????????????????鯔???????????????????C?????н??????????????