Thread: Simple Question

  1. #1
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001

    Simple Question

    I want a user to at anytime press a key and it will do something (ie: 'h' for help, etc.)
    I can cin, but the user would still have to wait for the opportunity to enter the command, i want them to be able to do it at anytime, sort of how mouse clicks work in windows programming.

    Second,
    can functions return arrays? IE: char[] mainMenu(void); ?
    or would it just be char mainMenu(void); (it will be a c style string so that's why i thought char wouldn't work) if I can't use the array, i'll just convert to a string.
    PHP and XML
    Let's talk about SAX

  2. #2
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >I want a user to at anytime press a key and it will do something (ie: 'h' for help, etc.)
    I can cin, but the user would still have to wait for the opportunity to enter the command, i want them to be able to do it at anytime, sort of how mouse clicks work in windows programming.<

    You can accomplish this by TSR or interrupts in protected mode.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    317
    Second, yes you can. Keep in mind that if you declare a char [] and then just return the name of the array, you are returning a pointer, aka char *.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple question regarding variables
    By Flakster in forum C++ Programming
    Replies: 10
    Last Post: 05-18-2005, 08:10 PM
  2. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-20-2005, 11:41 PM
  3. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 09:46 AM
  4. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 12:15 PM
  5. simple fgets question
    By theweirdo in forum C Programming
    Replies: 7
    Last Post: 01-27-2002, 06:58 PM