String compare isn't working correctly in C

view full story

http://stackoverflow.com – I can't figure out why my string compare isn't comparing correctly. This is for C. It's reading from a file that is set up like this: 1 - ls 2 - cd 3 - history If I type !c it's suppose to grab the last used string that started with 'c' and run the command. Yet it never goes into the if(strcmp(())=0) line. Part of my code is here: char currLine[MAXINPUTLINE]; else if (isalpha(input[1])){ int count = 1; fileRead = fopen(".simpleshell_history", "r"); while(fscanf(fileRead, "%s\n", currLine) != EOF){ printf(input+1); prin (HowTos)