Project 7: Compiling C on Windows 10 (15 pts.)

What You Need

Purpose

You will write a small C program and compile it.

Downloading and Installing Visual Studio Express Installer File

The Visual Studio file is 4.7 GB. If you can't download it at home, use the hacking lab.

In a Web browser, go to http://www.visualstudio.com/downloads/download-visual-studio-vs

On the left side, expand the "Visual Studio 2013 section. Click "Community 2013". On the right, click the Download button.

A file named vs_community.exe downloads. Navigate to that file in File Explorer, right-click it, and click "Run as Administrator".

If warning boxes pop up, approve running the software.

A "Visual Studio" box opens, as shown below.

Check the "I agree" box. Click Next

In the next box, clear all the check boxes, as shown below. Click Install.

Wait while software downloads and installs.

When the installation finishes, click LAUNCH.

A box appears, asking you to "Sign in". Click "Not now, maybe later".

Click the "Start Visual Studio" button.

Visual Studio launches, as shown below:

Creating a Simple C Program

On the let side, click "New Project...".

In the "New Project" window, on the left, click "Visual C++", as shown below.

In the center pane, click "Win32 Console Application"

At the bottom of the "New Project" window, type a Name of YOURNAME-1, replacing "YOURNAME" with your own name. Do not use any spaces in the name.

In the "Location" line, notice the location files will be saved in--it's a subfolder of your Documents folder.

In the "New Project" window, click OK.

A box opens, titled "Welcome to the Win32 Application Wizard".

Click Next. In the next screen, accept the default settings and click Finish.

A window opens, showing a simple C program.

Add this line to the program, as shown below.

Do not use the literal string "YOURNAME"--replace it with your own name.

printf("Hello from YOURNAME!\n");

Compiling your Program

Click BUILD, "Build Solution".

You should see the message "Build: 1 succeeded" at the bottom of the window, as shown below.

Running your Program

Click DEBUG, "Start Without Debugging".

A Command Prompt window opens, showing the message with your name in it, as shown below:

Saving the Screen Image

Make sure you can see the windows showing "Hello from YOURNAME!", as shown above.

On your keyboard, press the PrntScrn key.

Click Start, type in PAINT, and open Paint.

Press Ctrl+V to paste in the image of your desktop.

YOU MUST SUBMIT WHOLE-DESKTOP IMAGES TO GET FULL CREDIT.

Save the image with a filename of "Proj 7 from YOUR NAME".

Turning in Your Project

Email the image to: cnit.126sam@gmail.com with a subject line of Proj 7 From Your Name, replacing Your Name with your own first and last name. Send a Cc to yourself.

References

Creating a Win32 Console Application

Last Modified: 3-7-16 3 pm