Introduction to Computer Science

Using VC++ in the CS Lab Environment (VC++ 6.0)

Course Index

Below are instructions on how to build a Visual C++ project. The VC++ compiler uses a lot of disk activity during compiles. Everything works smoothest if you work on projects in a folder on a local hard drive and then copy the folder to a safe area (floppy disk or network space) for safekeeping. 

These steps will allow you to setup a project on a local hard drive and explain how to safely store that project for later retrieval.

  1. Start Visual C++ 6.0:
    Use Start --> Programs --> Microsoft Visual Studio 6.0 --> Microsoft Visual C++ 6.0.
  2. Select menu File->New.
    Select the "Projects" tab.
    Select "Win32 Console Application".
    Use the browse button to set the location. In general, you should select an existing folder such as the Desktop or the My Documents location. You may also create a folder off the root directory, but using your Desktop or My Document is a better choice. The next step will create a folder in this location to store the project files.
    In the "Project name" field, type the name of the project. (VCProject, for example.)
    Make sure "Create new workspace" is selected.
    Select "OK".
    When the Console Application Wizard appears, Select an Empty Project, and click "Finish".
    View and then accept the summary by Selecting "OK".
  3. Select menu File->New.
    Select the "Files" tab.
    Select "C++ Source File".
    Make sure "Add to project" is checked.
    In the "File" field, type the name of the cpp file to use. (main.cpp, for example).
    Select "OK".
  4. You can now enter the program. If you want to test a small sample program, type the following into the edit window. It will become the contents of your main cpp file.
    #include <iostream>
    main()
    {
     std::cout << "Hello, world!"<< std::endl;
     return 0;
    }
  5. Select menu Build-->Rebuild All or Build.
  6. Select menu Build-->Execute VCProject.exe.
  7. Before ending your session, select menu Build-->Clean. This will erase the contents of the temporary folders in the project. To do this manually, delete everything inside the Debug subfolder in your project folder.
  8. Select menu File->Exit.
  9. The project folder can now be safely moved to your network space (Z:) or to a floppy disk. You will run out of space very quickly if you forget to delete the contents of the Debug folder. You should erase the project folder from the local hard drive before logging off.