\n is just another character that printf() doesn't care about and doesn't do anything special with. What you may be confusing this with is how file are buffered. Output/Input can be delayed until the file is closed or until a "\n" is printed. stdio works this way, though I'm not sure if stdout does. (You can fflush(stdout); if needed...) Besides, there is no good reason for printf to specially treat or dislike a \n.
You can always read the manual on printf, which never mentions \n. Nor does anything I can find.
Should be obvious, but count your parentheses. You're one short.Code:if((string = strchr(firstname, '\n') != NULL)