The following code should take strings from the user (containing data of items in a storage).
I'm having trouble make the program iterate over to a new line. It aborts when I push "enter" but instead I need it to just take the next line as input. code:
for (i; i < STORE_SIZE; i++) {
fgets(seq, MAX_STRING_LEN, stdin);
if (strcmp(seq, "stop")) {
break;
}
else {
init(seq, ptr);
*(storage + i) = ptr;
}
}
The program should abort when it gets the string "stop" in the next line, and not by pushing enter.