What is the use of getch() function? What's it's alternative in C++14?
This function reads a single-byte character from the terminal associated with the current or specified window. I guess you're asking about the getch() we use before the last line of the program, right? When you run a .exe file you built, Your program will finish running and terminate itself after computing and displaying. But you won't be able to see the output. For that, just to stop there, so that you can see the output, we use getch(). Though it takes a character as input. you can use cin.get() as an alternative :)