-1

I want to get a char without having the need to wait for enter to be pressed, I also want it to echo on the screen. I tried getch() but it won't echo on the screen so it does not work for me.

luMi43
  • 9

2 Answers2

0

You can use getch() or getche(), both functions are in conio.h The difference is that getche() echo the character and getch() not. Here more about: https://www.c-lang.thiyagaraaj.com/archive/c-blog/use-of-getch-getche-and-getchar-in-c

asaklein
  • 74
  • 4
-1

Make use of getche() library function. It will echo the character on the screen, no need to press enter. Before using the getche() function "#include<conio.h>" header file in your program.