acct.c
来自「APUE(第二版)的随书源代码,与第一版的代码相比增加了一些章节的代码(详见第二」· C语言 代码 · 共 23 行
C
23 行
#include "lprps.h"/* Write the number of pages, hostname, and loginname to the * accounting file. This function is called by main() at the end * (if all was OK, by printer_flushing(), and by handle_intr() if * an interrupt is received. */voiddo_acct(void){ FILE *fp; if (end_page > start_page && acct_file != NULL && (fp = fopen(acct_file, "a")) != NULL) { fprintf(fp, "%7.2f %s:%s\n", (double)(end_page - start_page), hostname, loginname); if (fclose(fp) == EOF) log_sys("do_acct: fclose error"); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?