I'm a super beginner programmer. Basically I have got this code:
int main()
{
char name[30];
printf("Name of the animal exchange: \n");
scanf(" %s", &name);
char animalname[14];
int quantity = 0;
int quantitysum;
int type = 1;
do {
printf("A(z) %d. fajta neve: \n", type);
scanf(" %s", &animalname);
while(strlen(animalname)<15) {
printf("Quantity: \n");
scanf(" %d", &quantity);
quantitysum += quantity;
break;
}
if(strlen(animalname)<15) {
type++;
}
} while (animalname != "");
}
I thought the loop was supposed to stop with an enter pressed as stated in the while. What's the problem?