delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/09/21:16:39

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: <conio.h> questions
Date: Sat, 09 May 1998 21:06:31 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 34
Message-ID: <3554FD97.2AC5@cs.com>
References: <6j2u57$alk AT nnrp3 DOT farm DOT idt DOT net>
NNTP-Posting-Host: ppp119.cs.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Thomas Beauchamp wrote:
> 
> Could somebody please help me by sending me a small example program of
> conio.h input/output functions?  I know that you're all thinking that
> I'm an idiot, but I would really appreciate the help.

For information on conio functions, read the libc docs ("info libc func
conio").

#include <conio.h>

void clear_key_buffer( void )
{
    while ( kbhit() )
        getch();
}

int main( void )
{
    char line[100];
    char c;
    int x;

    clrscr();       /* clears screen */
    cprintf( "Please type a word:  " );
    cscanf( "%s", line );

-- 
---------------------------------------------------------------------
|      John M. Aldrich       |"Men rarely (if ever) manage to dream |
|       aka Fighteer I       |up a god superior to themselves. Most |
|   mailto:fighteer AT cs DOT com   |gods have the manners and morals of a |
| http://www.cs.com/fighteer |spoiled child."    - Lazarus Long     |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019