invdelet.c
来自「c和指针 学习c语言必须阅读的书籍之一 提高对C语言的掌握理解能力」· C语言 代码 · 共 30 行
C
30 行
/*
** Function to discard an inventory record.
*/
#include <stdlib.h>
#include "inventor.h"
void
discard_inventory_record( Invrec *record )
{
/*
** Delete the variant parts of the record
*/
switch( record->type ){
case SUBASSY:
free( record->info.subassy->part );
free( record->info.subassy );
break;
case PART:
free( record->info.part );
break;
}
/*
** Delete the main part of the record
*/
free( record );
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?