getchar() è una funzione BLOCCANTE. Significa che aspetta che venga premuto un tasto.
La funzione che ti serve è kbhit() (che non è ANSI).


Ciao.