I am looking for a command where i can press m and it pulls up my menu function. i feel retarded cause i tried to look it up but i dont know what i should look for exactly

i know qbasic has a inkey command but i cant figure it out on c++

Recommended Answers

All 4 Replies

Qbasic is not a general purpose platform-independent language, it's a concrete implementation of Basic language dialect. No keyboard notion per se in the C++ language. There are lots of keyboard access functions and libraries in C++ implementations.
What's your C++ compiler?

visual c++

Your best bet is to press "M<return>" and use fgets() to read the input and process the first character. It's portable and will work on ALL compilers.

visual c++

Have a look at non-standard header <conio.h>. Use getch/getche functions (in console mode applications only - hi, qbasic ;) ). If you are developing GUI application, keyboard key access depends of selected GUI platform...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.