CIS 22 - Data Structures: Frequently Asked Questions


  1. How do I do separate compilation?
  2. Why can't I include a .c file?
  3. What is a header file?
  4. How do I use a project?
  5. How do I redirect output to a file?


  1. How do I do separate compilation?

  2. Why can't I include a .c file?

    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.

  3. What is a header file?

    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.

  4. How do I use a project?

  5. How do I redirect output to a file?

    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 > outfile
    To 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 > outfile 
    at the command line.
Back to Top
Back to CIS 22 home page