Backstory: I'm making a C++ game (2 dimensional grid game) only using the Terminal on my Mac. So far I have code written that will initialize a map and code that will allow my character (an '&') to move by having a 2D array as a grid: array[11][44], and store each obstacle in a space in the array while any space the character can enter is a ' ' (character can't traverse onto any space there is an obstacle). When the grid/map is printed, the char input you give will determine if your character moves, which is basically setting the location you're at in the array to ' ' and the new space to '&' and then clearing and printing the new map. All this code works.
Question: When I input a, s, d, or w my character will move, however, you must press 'Enter'. I'm looking for a way to input one of these inputs and it be immediately read rather than have to press 'Enter' each time I want to move. Just finished my freshman year of college so thats why my knowledge of C++ is pretty basic and I don't know how to go about tackling this myself. I've looked into solutions including conio.h and the getch_() function but I don't know how to use them.