结构

C 语言结构通常位于 /usr/include/usr/include/sys 目录中的头文件中,但它们可以位于文件系统中的任何目录中。

声明的 XDR 结构几乎与其 C 语言对应项完全相同; 例如:

struct-definition:
      "struct" struct-ident "{"
      declaration-list
      "}"

declaration-list:
      declaration ";"
      declaration ";" declaration-list
将以下 XDR 结构与输出头文件中编译为 C 结构的二维坐标进行比较。

struct coord {          struct coord {
      int x;      -->          int x;
      int y;                   int y;

};                      };
                        typedef struct coord coord;

这里,输出与输入完全相同,除了添加的typedef在输出结束时。 因此,程序员可以使用coord而不是struct coord在声明项时。