How can you make the program read a button without using
getch();
or without pausing or stopping the program?
How can you make the program read a button without using
getch();
or without pausing or stopping the program?
Code:#if _emo #define stereo_type_i_dislike #endif
Use any of the standard functions that get input from the console in either cstdio or iostream. There will probably be some o/s specific ways aswell.
If you are programming on DOS platform you would write and INT 9 handler.
what does that excatly mean?
Code:#if _emo #define stereo_type_i_dislike #endif
The INT 9 handler is the interrupt 9. That is the system call to the keyboard. You can also do this in windows, too, using the WM_KEYUP and WM_KEYDOWN messages. I've used both ways quite a bit and they are both....not so easy for a beginner. For the dos method I usually use asm. The windows version is actually slightly easier, however, that all depends on how much windows experience you've had.
can you give me an example?
Code:#if _emo #define stereo_type_i_dislike #endif
im using dos
Code:#if _emo #define stereo_type_i_dislike #endif
are you really using dos or do you just think you are?
INT 9 handlers will not work in a console. You need real dos to do this.
What compiler are you using ?
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
I think it is borland C++ 4.0, but im getting Borland C++ 5.5
Code:#if _emo #define stereo_type_i_dislike #endif
I guess this is the same topic, so I'll post it here. For anyone that knows qBASIC, what's the C++ equivilent of inkey$? (I think that's what he wants).
make your life easy. Yes i believe that borland 4 had the ability to compile for dos but if you use a windows console instead (looks like dos, but is really just a simulated environment) then you can use the win32 api. Look into this or the other keyboard functions in the win32 api.
Do you really want to go to the trouble of writing an int 9 handler when you could just program for a windows console.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Do you really want to go to the trouble of writing an int 9 handler when you could just program for a windows console.
Yes. Console programs are very limited. For full DOS support compile for DOS. Why is an interrupt 9 handler so hard to write?
Look it up on a search engine and learn how to use setvect() and getvect(). It's really no different than writing a normal function in C. They've made it very easy to do int handlers in C.
console programs are really only limited in terms of graphics. If you want graphics then use the GUI side of the windows api or use opengl or directx. You will accomplish far more and your learning will be current. Why learn to program for dos anymore?
Even the boot to dos mode does not give you real dos. Even that is still a far cry from dos 4 (classic dos). What you get is a very butchered version of dos 6.2. There are some old dos programs that refuse to work even after booting win98 into dos.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi