[习题6]记忆C语言语法

2018-09-03  本文已影响1人  AkuRinbu

使用教材

《“笨办法” 学C语言(Learn C The Hard Way)》
https://www.jianshu.com/p/b0631208a794

switch

switch (OPERAND) {
    case CONSTANT:
        CODE;
        break;
    default:
        CODE;
}

for

for(INIT; TEST; POST) {
    CODE;
}

enum

enum{ CONST1, CONST2, CONST3 } NAME;

typedef

typedef DEFINITION  IDENTIFIER;
typedef unsigned char byte;
// DEFINITION unsigned char
// IDENTIFIER byte

struct

struct NAME {
    ELEMENTS;
} [VARIABLE_NAME];
// [VARIABLE_NAME] 是可选的

typedef+struct

typedef struct [STRUCT_NAME] {
    ELEMENTS;
} IDENTIFIER;

union

union NAME {
    ELEMENTS;
} [VARIABLE_NAME];

上一篇下一篇

猜你喜欢

热点阅读