printchk.c

来自「C_C++程序员实用大全(精华版)源代码 代码详实 一步一步深入 适合各阶段」· C语言 代码 · 共 41 行

C
41
字号
#include <bios.h>
#include <conio.h>
#include <stdio.h>

void main(void)
  {
    int status = 0;
    int old_status = 0;

    do
     {
       status = biosprint(2, 0, 0);  // Read LPT1       
	   
       if (status != old_status)
	 {
	   if (status & 1)
	     printf ("Time-out\t");

	   if (status & 8)
	     printf ("Output Error\t");
 
	   if (status & 16)
	     printf ("Printer Selected\t");
       
	   if (status & 32)
	     printf ("Out of Paper\t");

	   if (status & 64)
	     printf ("Acknowledge\t");

	   if (status & 128)
	     printf ("Printer Not Busy");
	  
	   printf ("\n");
	 
	   old_status = status;
	}
      }
    while (! kbhit());       
  }

⌨️ 快捷键说明

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