0
how to use getchar() to avoid an enter?
please help me ,thanks!
3 Antworten
0
get char only takes one character you better use fgets
btw here is how you use getchar-
#include <stdio.h>
int main() {
char name;
puts("Enter your name");
name = getchar();
puts("Name entered: ");
putchar(name);
return 0;
}
0
If you need direct input I can recommend you "system ("/bin/stty raw"); " for linux systems or libraries like ncurses
0
ty guys so much!