-
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.
-
>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.
-
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 *.