基本知识

struct{
    int x;
    int y;
} point;

struct poinit p;
p.x=1;

结构与函数

  • 结构指针

    struct point *pp;
    (*pp).x=5;
    y = pp->x;
    

结构数组

struct poinit ps[20];

结构指针

结构体中的数据对齐问题

自引用结构

struct{
    int x;
    int y;
    struct point *p;
} poinit;

表查找

类型定义

typedef char* String
String s = "123";

联合

union ut{
    char a;
    int b;
    long c;
}u;

u.c=1L;

位字段

results matching " "

No results matching " "

results matching " "

No results matching " "