The main program can be simplified by using a function you probably haven't read about yet callcalled fgetsfgets. This function reads a line of text at a time. The variable lineline will contain the new line after the function has been called,called; you would need to remove the new linenewline before you reverse the input.
int main() { char line[BUFSIZ]; while (fgets(line, BUFSIZ, stdin) != NULL) { if (line[0]) { reverseLine(line); printf("%s\n", line); } } }