Ok, guys I had an idea, I want to make a program that counts how many characters you type, but I don't know how to make an input of one character at a time without pressing enter, neither how to make a display that changes every time you press a key. so far this is what I got of code
Code:
#include <stdio.h>
#include <stdlib.h>
int cont;
char sig[1];
int main(void){
printf("start counting");
for(;;){
cont=0;
scanf("%c", sig);
if(sig!="q"){
cont++;}
else{break;}
}
printf("%d", cont);
}
I thought it would work fine but it doesn't quit if I press "q", plus I have to pres enter for this program to count one character.