read "control d" from the keyboard

This is a discussion on read "control d" from the keyboard within the C++ Programming forums, part of the General Programming Boards category; im trying to create a main function that prints out some values when the user hits control d. how do ...

  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,493
    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, 05:23 PM
  2. What Would You Use To Read User Input?
    By djwicks in forum C Programming
    Replies: 11
    Last Post: 04-05-2005, 04: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, 03:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21