home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4482 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  1.8 KB

  1. Path: sparky!uunet!stanford.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340
  2. From: dic5340@hertz.njit.edu (David Charlap)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: C Set/2 Problem with getch()
  5. Message-ID: <1992Aug27.191812.25082@njitgw.njit.edu>
  6. Date: 27 Aug 92 19:18:12 GMT
  7. References: <5s-n5j.feustel@netcom.com> <1992Aug24.203004.2629@njitgw.njit.edu>
  8. Sender: news@njit.edu
  9. Organization: New Jersey Institute of Technology, Newark, N.J.
  10. Lines: 27
  11. Nntp-Posting-Host: hertz.njit.edu
  12.  
  13. In article <1992Aug24.203004.2629@njitgw.njit.edu> dic5340@hertz.njit.edu (David Charlap) writes:
  14. >In article <5s-n5j.feustel@netcom.com> feustel@netcom.com (David Feustel) writes:
  15. >>I'm trying to use getch() in C Set/2 to read from the keyboard with no
  16. >>echo. Link386 reports getch() not found.
  17. >
  18. >According to the Unix box I have here, you should use getchar().
  19. >That's in <stdio.h>.  The getch() function is a curses function and is
  20. >located in <cursesX.h>, a header/library that probably isn't available
  21. >for OS/2 yet, and certainly doesn't ship with C Set/2.
  22. >
  23. >I getch() is a common language extension, but it isn't ANSI.  So
  24. >there's no gurantee that it should exist.  Just because Microsoft and
  25. >Borland used it, doesn't mean that everyone does.  (IBM's old C/2
  26. >compiler was MS-C repackaged)
  27.  
  28. A correction to myself:  C-Set/2 does indeed have getch().  It is
  29. located in the <conio.h> header, just like it is under Microsoft C.
  30. Sorry for the confusion.  I assumed that since you used it before in a
  31. DOS compiler, that you had already included <conio.h>.
  32.  
  33. Note that <conio.h> is non-ANSI, and shouldn't be used if you want
  34. your code to be completely portable.
  35. -- 
  36.    |)  David Charlap           "I don't even represent myself
  37.   /|_  dic5340@hertz.njit.edu   sometimes so NJIT is right out!.
  38.  ((|,)
  39.   ~|~  Hi! I am a .signature virus, copy me into your .signature file.
  40.