delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/17/04:00:25

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: char getch(void)
Date: Thu, 15 Jan 1998 22:48:00 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 38
Message-ID: <34BED870.10EB@cs.com>
References: <B0000118700 AT plovdiv DOT techno-link DOT com>
NNTP-Posting-Host: ppp235.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ivo Stoykov wrote:
> 
> > unpleasant ways if you continue:  conio and stdio I/O routines are not
> > intended to be used simultaneously (this in general holds for any I/O
> > manager, such as curses, etc.).  Instead you should be using one or the
> >
> 
> Sorry that rush into but your reply arose a new question:
>         Is there a place where a new user could which *.h files could and
>         which could not be used simultaneously?

You could use a programming manual... unfortunately most of the popular
ones commit the error of assuming that stdio and conio are
interchangeable.  It seems to be a common flaw in the literature.  A
good place to look for both general and specific ANSI C questions is the
comp.lang.c FAQ (http://www.eskimo.com/~scs/C-faq/top.html).

It's not that you _can't_ use stdio and conio functions simultaneously;
it's just that you have to understand how they interact to use them
properly.  conio functions write directly to text video memory, while
stdio functions write to DOS file descriptors.  Their input functions
differently as well; conio deals with individual characters and key
codes, while stdio reads buffered input.  These differences can be
worked around if you invest a little effort.

In general, though, any two separate sets of functions designed to
perform the same task (conio and curses, Allegro and GRX, SWORD and
MTTWS, MIDAS and MikMod) are going to be substantially incompatible with
each other.  The other main thing to recognize is that conio.h is not an
ANSI header.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Be wary of strong drink.  It can    |
|       aka Fighteer I       | make you shoot at tax collectors--   |
|   mailto:fighteer AT cs DOT com   | and miss."                           |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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