CS 2073 Engineering Programming
Running C Programs, Spring 2006


Available Systems to run C:


Using Microsoft Visual C++ 6.0: Fortunately, there are simple steps that allow us to run a simple C program without using much of the features available with this very complicated software. Here are the simplest steps that I know of. I will use them class:

  1. From the "Start" button, go up to "Microsoft Visual Studio 6.0" and then to "Microsoft Visual C++ 6.0". Click on this program to start it up.

  2. Pull down the "File" item at the upper left, and click on "New".

  3. In the box provided, click on the "Files" tab.

  4. In the list provided, click on "C++ Source File".

  5. You can enter a name is the place provided, say in the first example dist.c, or just use the default name.

  6. Click on "OK" in the box.

  7. Now a white area will appear, where a C program belongs.

  8. Use copy and paste or just enter a C program that you want to run.

  9. Pull down the "Build" item at the upper middle, and click on "Compile". (Click "Yes" to the question about a project file not existing, or click "Yes" to the question about overwriting an existing project file. Note that this may overwrite your last project.)

  10. Pull down the "Build" item at the upper middle, and click on "Execute". (Click "Yes" to the question about an executable file not existing, or click "Yes" to the question about overwriting an existing executable file. Note that this may overwrite your last executable.)

At this point, a black window will appear that holds the output of your program. If you have to enter any data for the program, it will appear in this box.


Making up a file for program submission: Open an empty Notepad window ("Start" --> "Accessories" --> "Notepad").

  1. Copy the original program from Visual Studio (using mouse selection and ctrl-c), and paste it it into the Notepad window (using ctrl-v).

  2. We want to copy the output in the black window into the Notepad window at the end. In order to do this, use a sneaky little icon at the extreme upper left of the black window. By pulling down a menu from this icon, you can select everything in the black box, and copy it for later pasting.

  3. Use ctrl-v to paste the copied contents of the black box (the results of executing the program) into the Notepad document after the program source.

  4. You can get access to the file inside the Notepad by emailing it to yourself. One easy way is to use your UTSA Lonestar account to email it to yourself (or elsewhere):

    or you could store in into a USB stick or even (gulp!) a floppy disc.

  5. We can also use the sneaky icon of step 2 to copy input into the black window, instead of having to type all input by hand.

  6. Now go on to the directions for submitting the program and its output: Submission directions.


Under Bloodshed, keeping the black box from disappearing: If you use the Bloodshed.net compiler, you will need some way to keep the black box from disappearing?

One method is to include an extra (redundant) "scanf" statement (or something like it) at the end of your program, so that at the end of your run, everything will pause while it waits for you to enter data. One possible form of this method looks as follows, where you add the stuff in red below. (Go ahead and add it whether you understand it or not.)

By the way, in Bloodshed, you can use the same little icon at the upper left to select all, and copy (or to paste) using the black box.


Revision date: 2006-01-22. (Please use ISO 8601, the International Standard.)