Lab 7 — Microsoft Visual Studio (continued)

Wednesday, December 9, 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 copy your files from Programming Assignment #6 into this directory. You should not have a makefile. 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 or more of your working functions, and a .h file containing the data types and function prototypes to hold them together.

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. Fix them now!

By the end of this lab, your program should build without errors or warnings, even if it is not complete and does not yet run correctly. If it does not build successfully, please seek help from the TAs.

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>

When you have completed Programming Assignment #6, submit the final version as instructed in that assignment.

Have a nice holiday!