CSC 160 - Microsoft Visual C++ Quick Reference

This is a re-munge of the instructions found in Appendix A of our lab manual.

Disk Space - the k: drive

You will use the shared k: drive to store your programming work for class. Your folder is located at:

k:/03wi/csc1602/

You should see two sub-folders at this location:

Your lab work and your programming assignments will go in your k: drive folder.

Opening an existing C++ file

Often, you will start with an existing C++ file and modify it. These files will usually be found in the "Common Area" folder in the k: drive for our class. Here are the steps you need to follow to use existing files in Visual C++.

  1. Either start Visual C++ or make sure all workspaces are closed when starting
  2. Click on File/Open to read the file into Visual C++ (usually from the "Common Area" folder in the k: drive for our class)
  3. Click on File/Save As and save the file to one of your folders (usually in your k: drive folder)
  4. You can now compile this file by selecting Build/Compile. You will get a message that this will require a project workspace... click yes to this message
  5. You can execute the program by selecting Build/Execute. You may get a message asking if you want to build this file... click yes to this message.
  6. Barring any errors, your program should now run in a separate console window.

Creating a new C++ file

To create your own C++ file from scratch, follow these steps:

  1. Again, make sure all workspaces are closed prior to starting.
  2. Click on File/New/Files and then select C++ source file. On the right side, enter the file name and location (in your k: drive folder).
  3. After creating your C++ file, you can follow the compile and execute steps above to run your program.