I am trying to parse a given textfile, but so far, my program does not seem to be reading properly.
#include int main(int argc, char *argv[]) {
argv[0] is the name of the program (./sjf in your case), so you're trying to read in your own program's executable. Use argv[1] instead to get the first real program argument.
argv[0]
./sjf
argv[1]