0

I want to be able to input single characters without pressing enter, following is a sample code. Is there any way to do it so it runs on every machine?

#include <stdio.h>
#include <stdlib.h>
int main() {
    char c;
    c = getc(stdin);
    while(c != 'e'){
        printf("ok");
        c = getc(stdin);
    }
    printf("done");
    return 0;
}
Labeeb
  • 5
  • 2

0 Answers0