0
I want to use arrow keys to up and down between 3 options 1-game, 2-options,3- exit and exit its on 3rd option by clicking Enter
C++ using arrow keys
2 Answers
+ 1
First, make sure that conio.h is included.
if(kbhit()){
char a=getch();
if(a == 72)//up arrow
//do sth
else if(a==80)//down arrow
//do sth
else if(a==13)//enter key
if(choice == 1) //you must declare 'choice'
Game();
else if(choice == 2)
Options();
else return 0;//end program
}
That is my solution. Maybe there are some better solution👍
+ 1
Thank you very much