home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20088 < prev    next >
Encoding:
Text File  |  1993-01-23  |  2.5 KB  |  70 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!sunic!seunet!swbull!proxxi.uf.se!elias
  3. From: elias@proxxi.uf.se (Elias M}rtensson (proxxi))
  4. Subject: Re: Few simple questions
  5. Message-ID: <1993Jan22.143725.334@proxxi.uf.se>
  6. Organization: proxxi
  7. References: <1993Jan21.001022.46578@kuhub.cc.ukans.edu>
  8. Date: Fri, 22 Jan 1993 14:37:25 GMT
  9. Lines: 59
  10.  
  11. kugold@kuhub.cc.ukans.edu writes:
  12.  
  13. >1. In unix, the backspace key does not work properly. I already 
  14. >   found out that this can be changed by typing stty erase ^?, where '^?' 
  15. >   means ctrl-?. I tried to include this in my .login file, but emacs does 
  16. >   not accept ^?. How do I put this line in my .login file?
  17.  
  18. Backspace? Surely you must mean that the "delete" key does not work
  19. properly. Emacs uses it's own key bindnings, and usually delete is
  20. the rubout character. You can change both the delete and the backspace
  21. characters to whatever you want by putting something like the
  22. following in your .emacs file:
  23.  
  24. ; This will set backspace to be the rubout character
  25. (global-set-key "\C-h" 'backward-delete-char)
  26. ; This will do the following to delete
  27. (global-set-key "\C-?" 'backward-delete-char)
  28.  
  29. >2. In C I need an input function like INKEY$ in BASIC, that is a function that
  30. >   does _not_ wait for input, but just an empty string or so returns if no 
  31. >   character is entered. (I am trying to measure the time between two key-
  32. >   presses). Does this function exist, and if not, is there any way to do
  33. >   what I want?
  34.  
  35. If the time to be measured is short (like tenths of seconds and you really
  36. need this detail) there is no portable way to do it since UNIX is not a
  37. realtime operating system. But you can try to check the number of
  38. characters is the queue by using an ioctl() call.
  39.  
  40. >3. In C again, I want to initialize and array of integers, like
  41. >   
  42. >   main()
  43. >   {
  44. >     int ttime[6]={0,0,0,0,0,0}
  45. >     /* rest of program */
  46. >   }
  47.  
  48. [error messages removed]
  49.  
  50. >   I really don't see what is wrong, the more because in my c-book,
  51. >   "C by discovery" by L.S. Foster on page 213, almost exactly the
  52. >   same thing is done.
  53.  
  54. This one is easy, your compiler is not an ANSI-C compiler. Try gcc or
  55. some other ANSI-compiant compiler instead.
  56.  
  57. >Thanks a lot in advance for any answer and I am sorry if the UNIX question 
  58. >doesn't belong in this newsgroup.
  59.  
  60. >Regards,
  61.  
  62. >Wimjan
  63.  
  64. >kugold@kuhub.cc.ukans.edu 
  65.  
  66. ######################
  67. #   Elias Martenson  #
  68. # elias@proxxi.uf.se #
  69. ######################
  70.