When you include a file, it is as if the included file has been "cut and pasted" into the file you are working with. If you include a .c file, you are essentially combining all the code into one file, and compiling it all at once, which defeats the purpose of separate compilation.
Header files contain information needed by the compiler telling it about functions that are not in this file. By convention, they are named with a .h extention. If this file contains a reference to a function in another file, the compiler needs to know the function prototype in order to match and compile your function call.
Redirecting output can to be done from the command line. To redirect output from the Unix command line, compile your program, and then type
progname.out > outfileTo redirect output of the program compiled under Windows, find the location of your executable file. Under DOS, change the current directory to the directory where your executable file is located, and type
executablename > outfileat the command line.