To avoid problems, use these following options -std=c99 -Wpedantic You can just put the following in a Makefile CFLAGS=-std=c99 -Wpedantic When using scanf (space) matches 0 or more space Actually most specifier matching leading whitespace but (space) is clearer whitespace includes "newline" characters %[....] matches characters in ..... %[^....] matches characters not in ..... %[ matches characters, numbers What if the string has spaces immediately before the comma (,) well..... is that covered in the rules? Probably, but you can just look at the read string Last characters of strings are a position strlen(s)-1, strlen(s)-2, ... What about input items spread accross several lines well..... is that covered in the rules? University of North Carolina at Asheville, Asheville, 3821 If you want to fix this, you can read to an entire line with fgets read characters with fgetc