Kako provjeriti da li je unešen samo enter?
Dio koda izgleda ovako
Code:
while(1)
{
printf("x? ");
gets(checkX);
if (*checkX == ?)
break;
else
x=atoi(checkX);
}
while(1)
{
printf("x? ");
gets(checkX);
if (*checkX == ?)
break;
else
x=atoi(checkX);
}
Pokušao sam sa if(strcmp(checkX, "\n")) i if(strcmp(checkX, "\r\n")), ne funkcioniše.