Which compiler are you using? getline isn't standard C so its behavior is implementation defined. That said, assuming you and your prof are using the same compiler it's much preferable to gets and fgets.
Here's how it works for GCC (note it even requires a GNU-specific definition, lest there be any misconception about its portability):
size_t LINE_LEN = 1024;
char* line = malloc(LINE_LEN);
getline(&line, &LINE_LEN, stdin);
Which just echos back the first input line. (NB: I'm not a C programmer, that code may not be 100% trustworthy, but it seems to work)
I know you're good on the parsing end of it, but just as a quick note strtok() is probably very useful here in addition to scanf().