When I enter "quit" on my keyboard, the if loop (marked by the comment "here quit is implemented") should return true and the program should end. But strcmp does not return zero. There are no compiler errors. I am not able to identify the problem.
int numInput(){
char str[10];
int num;
char nStr[10];
char q[4] = "quit"; //Quit
LAND:
scanf("%s",&str);
if (strcmp(q,str) == 0){ //Here quit is implemented
exit(0);
}else{
printf(str);
}
num = atoi(str);
itoa(num,nStr,10);
if (strcmp(nStr,str) != 0){
printf("Please enter numbers only!\nEnter number here:");
goto LAND;
}
return num;
}