for some reason it always return 1; lets say char line will have a empty line or not empty line.
int main(void)
{
char line[20];
//user may enter some word or enter nothing in LINE
if(empty_line(line) != 0)
{
//...
}
}
int empty_line(char line[])
{
for(i = 0; i < 20; i++)
{
if(line[i] == ' ' || line[i] =='\t' || line[i] == '\n')
{
}
else
{
return 1; //not empty
}
}
return 0; //empty
}