I can't get strcmp() to return 0 with the following code. please help..
char quit[10] = "q";
scanf(buf, "");
fgets (buf, 100,stdin);
fflush(stdin);
if(strcmp(quit, buf) == 0) {
printf("Quiting program\n");
...
when I type 'q' into the command line it should enter that if statement, but it doesn't.