How to Produce Test Runs of your C Program

  1. From the "Main" folder, double click MS-DOS Prompt to get a command-line (DOS) prompt. You should see something like this:
         +------------------------------------------------------------
    	       _ Type EXIT and press ENTER to quit this MS-DOS prompt 
    		 and return to Windows.
    	       _ Press ALT+TAB to switch to Windows or another
    	         application.	Press ALT+ENTER to switch this MS-DOS
    	         Prompt between a window and full screen.
         +------------------------------------------------------------
         
         Microsoft(R) MS-DOS(R) Version 6.22
    	          (C)Copyright Microsoft Corp 1981-1994.
         H:\>
    
    Note if you see "X:\>", you should type "H:" to switch to your home drive ("H").
  2. If your assignment files are in a subdirectory, Use the Change Directory ("cd") command to go to that subdirectory. For example, if the directory is named ASST1, you would type:
         H:\>cd asst1
    
  3. Use the "dir" command to check that the directory contains the files that you expect.
         H:\ASST1>dir
          Volume in drive H is USER2
          Volume Serial Number is 01B0-847C
          Directory of H:\ASST1
         
         APPT	 C	     4,825 02-05-97   1:42p
         TEST1	 IN		18 02-05-97   4:08p
         APPT	 H	     3,044 02-05-97   1:42p
         APPTCAL  	 C	    10,525 02-05-97   1:42p
         APPTCAL  	 H	     4,999 02-05-97   1:42p
         BOOL	 H		77 02-05-97   1:42p
         QUEUE	 C	     2,668 02-05-97   1:42p
         QUEUE	 H	     2,609 02-05-97   1:42p
         T	 	 C	     8,892 02-05-97   1:42p
         TIME	 C	     3,529 02-05-97   1:42p
         TIME	 H	     2,252 02-05-97   1:42p
            13 file(s)	  43,438 bytes
    	1,638,400 bytes free
    
  4. Compile and link your .c files, using the "bcc" command:
         H:\ASST1>bcc appt.c apptcal.c queue.c t.c time.c
         Borland C++ 4.52 Copyright (c) 1987, 1994 Borland International
         appt.c:
         [Lots of warnings may appear.]
    
  5. If your program compiled successfully, then an executable version of it will now exist. It will be named after the first file in your bcc command (in this case "appt"), and will have a ".exe" (for "executable") extension. So in our example, we have an executable program called "appt.exe". To run it normally, you can simply type it's name.

    To run your program with input from a file (e.g., "test1.in") and output to a file (e.g., "test1.out") use the "less than" and "greater than" symbols as follows:

         h:\appt < test1.in > test1.out
    
    You can do this any number of times with different input and output files.
  6. Then print your program files, input files, and output files. To print a file, open and print it from your favourite editor.