typedef

对已有数据类型指定别名。

语法

typedef <existing_name> <alias_name>;

示例

typedef unsigned int uint;
struct node {
    int data;
    struct node* next;
};
typedef struct node Node;

/*----- 等同于 -----*/

typedef struct node {
    int data;
    struct node* next;
} Node;

results matching ""

    No results matching ""