When comparing strings in C, you can't use == or != directly. You have to call the function strcmp() for "string compare".

This is because "\n" is a string constant located somewhere in memory,...