Lab 7 — Microsoft Visual Studio (continued)

Wednesday, April 29, 2009

Objective

·         To gain more experience using Microsoft Visual Studio.

Introduction

This week, you will build on last week’s lab and use Microsoft Visual Studio for your own project.

Getting Started

1.      Sign the attendance sheet.

2.      Create a directory to hold the files for Lab 7, and change to that directory now. Copy your files from Programming Assignment #6 into this directory. Throw away the makefile, if you have one. Follow the same steps as in Lab 6 to create a project in Visual Studio from existing code.

3.      If you have not yet started Assignment #6, you should start it now. Create a .c file containing a simple main() function, a second .c file containing the stub of one of your working functions, and a .h file containing the data types and function prototypes to hold them together.

Alternatively, you may use Assignment #5, which you should have already finished.

4.      Try to build the code by pressing the ‘F6’ button or clicking ‘Build Solution’ from the ‘Build’ menu. You should see the results of the build in the ‘Output’ window at the bottom of the Visual Studio screen.

5.      It is likely that you will have programming errors in the files you are building. There are some differences between C as compiled by gcc and C as compiled by Visual Studio. An example of such a difference is that with Visual Studio, all declarations in any function or compound statement must precede any statements. You will probably find others.

6.      Debug and run your program the same way you did in Lab 6, for example, by forcing it to call getch() before exiting, in order to keep the console window visible. Experiment with debugging your program.

7.      Clean your project, exit Visual Studio, open a window on your Lab 7 folder, and zip your files together and submit them using the following command:–

/cs/bin/turnin submit cs2301 LAB7 <your zipped file name>

Remember, when you submit Programming Assignment #6, you may submit it either as a gcc project with a makefile or as a Visual Studio project.

Have a nice summer!