Thread: read "control d" from the keyboard

  1. #1
    Unregistered
    Guest

    read "control d" from the keyboard

    im trying to create a main function that prints out some values when the user hits control d.

    how do i do that?

    thanks!

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    i should know this, but it's never come up for me...
    read the scancodes, then test to see if its a ctrl-d (there are two ctrls).

    note: ctrl-d is the end-of-file character for unix machines, so keep it in mind in case you're reading it from a file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How can I know the actual bytes read in a file read
    By pliang in forum C++ Programming
    Replies: 1
    Last Post: 06-08-2005, 04:23 PM
  2. What Would You Use To Read User Input?
    By djwicks in forum C Programming
    Replies: 11
    Last Post: 04-05-2005, 03:32 PM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. I am lost on how to read from file and output to file?
    By vicvic2477 in forum C++ Programming
    Replies: 4
    Last Post: 02-27-2005, 11:52 AM
  5. Help! Can't read decimal number
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-07-2001, 02:09 AM