⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prtoggle.c

📁 国外网站上的一些精典的C程序
💻 C
字号:
/***  prtoggle()****  Tee's all standard output to the printer.****  Parameters: None****  Returns:  0 if operation was successful.**           -1 if stdout or stdin is redirected.****  Side effects: Flushes the keyboard buffer****  Original Copyright 1988-1991 by Bob Stout as part of**  the MicroFirm Function Library (MFL)****  The user is granted a free limited license to use this source file**  to create royalty-free programs, subject to the terms of the**  license restrictions specified in the LICENSE.MFL file.*/#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <io.h>#include "sniptype.h"#include "sniprint.h"#include "snipkbio.h"int prtoggle(void){      if (!isatty(fileno(stdin)) || !isatty(fileno(stdout)))            return -1;      while (kbhit())           /* Flush the keyboard buffer            */            getch();      ungetkey('P' - 64);       /* Stuff a Ctrl-P into the buffer       */      system("");               /* Let COMMAND.COM do the work          */      return 0;}

⌨️ 快捷键说明

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