+ 3
You first have to include conio.h, define the key codes of the keys you want to detect, then use the getch() method in a switch statement to detect the key press of the keys you specified and act accordingly. Code example here:
https://stackoverflow.com/questions/24708700/c-detect-when-user-presses-arrow-key