inventor.h

来自「《c与指针》书的代码 是我学习这本书时候敲出来的」· C头文件 代码 · 共 35 行

H
35
字号
/*
** Declarations for the inventory record.
**
**	Structure that contains information about a part.
*/
typedef struct	{
	int	cost;
	int	supplier;
	/* etc. */
} Partinfo;

/*
**	Structure to hold information about a subassembly.
*/
typedef	struct	{
	int	n_parts;
	struct	SUBASSYPART {
		char	partno[10];
		short	quan;
	} *part;
} Subassyinfo;

/*
**	Structure for an inventory record, which is a variant record.
*/
typedef	struct	{
	char	partno[10];
	int	quan;
	enum	{ PART, SUBASSY }	type;
	union	{
		Partinfo	*part;
		Subassyinfo	*subassy;
	} info;
} Invrec;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?