How to Compile, Link, and Execute C or C++ Codes Using Microsoft Visual C++

Similar documents
Appendix K Introduction to Microsoft Visual C++ 6.0

MS Visual C++ Introduction. Quick Introduction. A1 Visual C++

Visual Studio 2008 Express Editions

Microsoft Visual Studio 2010 Instructions For C Programs

3 IDE (Integrated Development Environment)

Introduction to the use of the environment of Microsoft Visual Studio 2008

Appendix M: Introduction to Microsoft Visual C Express Edition

This document details the following four steps in setting up a Web Server (aka Internet Information Services -IIS) on Windows XP:

How to install and use the File Sharing Outlook Plugin

Lab: Data Backup and Recovery in Windows XP

Note: Before E-Z Mail can be installed; Microsoft Outlook or Lotus Notes must be installed on your system.

Rational Application Developer v7.0 (RAD7) trial version. Installation guide

Creating a Simple Visual C++ Program

Lab - Data Backup and Recovery in Windows XP

Stellar Phoenix Exchange Server Backup

Also you need the C-MOR ISO file. This file you will find following this link:

Working with Office Applications and ProjectWise

Mail Merge (Microsoft Office 2010)

How to install FlexiCAD 3

Nexsure Training Manual - Admin. Chapter 11

Notepad++ The COMPSCI 101 Text Editor for Windows. What is a text editor? Install Python 3

TRIAL SOFTWARE GUIDE 1. PURPOSE OF THIS GUIDE 2. DOWNLOAD THE TRIALSOFTWARE 3. START WIDS 4. OPEN A SAMPLE COURSE, PROGRAM

Visual C Tutorial

Downloading RIT Account Analysis Reports into Excel

Enhanced Attendance Reporting for SmartLock Pro Plus OPERATOR GUIDE

Lab 2 - CMPS 1043, Computer Science I Introduction to File Input/Output (I/O) Projects and Solutions (C++)

Installing Client Profiles 6.0

5.6.2 Optional Lab: Restore Points in Windows Vista

DEPLOYING A VISUAL BASIC.NET APPLICATION

Avery Wizard: Using the wizard with Microsoft Word. This is a simple step-by-step guide showing how to use the Avery wizard in word

Overview... 2 How to Add New Documents... 3 Adding a Note / SMS or Phone Message... 3 Adding a New Letter How to Create Letter Templates...

Install the Production Treasury Root Certificate (Vista / Win 7)

Pacesetter BES Lettering Installation Guide

Code::Blocks Student Manual

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

Filtering with Microsoft Outlook

Using a Remote SQL Server Best Practices

Pharmacy Affairs Branch. Website Database Downloads PUBLIC ACCESS GUIDE

How to set up Outlook Anywhere on your home system

3. Locate the different selections of Styles from the Home Tab, Styles Group

Creating Rules in Outlook

Tech Tips Helpful Tips for Pelco Products

1. Open Thunderbird. If the Import Wizard window opens, select Don t import anything and click Next and go to step 3.

Windows XP Home Edition / Windows XP Professional

JAVS Scheduled Publishing. Installation/Configuration... 4 Manual Operation... 6 Automating Scheduled Publishing... 7 Windows XP... 7 Windows 7...

Backing up Microsoft Outlook For the PC Using MS Outlook 2000 Keith Roberts

BioWin Network Installation

Installing S500 Power Monitor Software and LabVIEW Run-time Engine

SuperOffice AS. CRM Online. Installing the Citrix Online Web plug-in

How To Deploy Office 2016 With Office 2016 Deployment Tool

How to manage the Adaptive Call Recorder (v.9-50)

Troubleshooting Guide

Microsoft Access 2007 Advanced Queries

Basics. a. Click the arrow to the right of the Options button, and then click Bcc.

MS WORD 2007 (PC) Macros and Track Changes Please note the latest Macintosh version of MS Word does not have Macros.

3. USB DRIVER Installation of USB driver Driver for Infinity SD Data Logger. INFINITY Series Acquisition Tools Manual

Quick Start Guide. Microinvest Warehouse Pro Light Restaurant

1. After installing you can launch the program by clicking on the Start button and then select Programs, then WS_FTP LE, and then WS_FTP LE.

Presentations and PowerPoint

Deposit Direct. Getting Started Guide

Moving PCLaw Data to Another Location (For LexisNexis PCLaw TM version 8.20 and higher)

How to Copy Photos to a CD Using Microsoft Windows XP or Microsoft Windows Vista

ProjectWise Explorer V8i User Manual for Subconsultants & Team Members

Registration Instructions. Visual Basic 2010 Express Software

Batch Eligibility Long Term Care claims

Important Note Regarding Your Blu ray Drives

Word 2010: Mail Merge to with Attachments

How to deploy fonts using Configuration Manager 2012 R2

HOW TO BURN A CD/DVD IN WINDOWS XP. Data Projects

To successfully initialize Microsoft Outlook (Outlook) the first time, settings need to be verified.

AT&T Global Network Client v6.8.0 and Passport IP Setup Instructions for Broadband VPN Access

Installation Guide. Your FedEx Ship Manager system number. Before you start

Setup for PCCharge. Important Pre-Installation Notes for PCCharge. Installation Overview. Step 1 Install And Set Up PCCharge on the Fileserver

Configuration Guide. Remote Backups How-To Guide. Overview

Setting up VMware ESXi for 2X VirtualDesktopServer Manual

educ Office Remove & create new Outlook profile

Technical Script AIST3410 Database Management systems p 1

Instructions for Installing and Using the FOCUS DL-15 Data Transfer Software

StarWind iscsi SAN Software: Installing StarWind on Windows Server 2008 R2 Server Core

Installing the Microsoft Network Driver Interface

Windows 2000/XP Network

etoken Enterprise For: SSL SSL with etoken

Windows XP Home Edition / Windows XP Professional

SQL Server Setup for Assistant/Pro applications Compliance Information Systems

+27O.557+! RM Auditor Additions - Web Monitor. Contents

Creating Cost Recovery Layouts

Appointments Module. User s Manual

Guide to Setup using Microsoft Outlook Express

Using Microsoft Visual C++ Developer Studio

Jolly Server Getting Started Guide

Crystal Reports Installation Guide

CS106B Handout #5P Winter January 14, 2008

INSTALLATION GUIDE Version 1.2

XConsole GUI setup communication manual September 2010.

Virtual Office Remote Installation Guide

MONITORING PERFORMANCE IN WINDOWS 7

October, Install/Uninstall Xerox Print Drivers & Apps Best Practices for Windows 8, 8.1, and 10 Customer Tip

Midland BT Updater BTUpdater Program Program file (x86) ), Midland

LPR for Windows 95/98/Me/2000/XP TCP/IP Printing User s Guide. Rev. 03 (November, 2001)

Transcription:

How to Compile, Link, and Execute C or C++ Codes Using Microsoft Visual C++ 1. First, you need to click Start button, Programs, and then Microsoft Visual C++ 5.0 or 6.0 to launch MS Visual C++, shown in Figure 1. Figure 1 Start Visual C++ program. 2. Close Tip of the Day message window shown in Figure 2, by clicking Close button. Now you are in Visual C++ program, shown in Figure 3. file:///d /VIT_WSIPL/HowVisualCPP.htm (1 of 17)1/31/2004 6:56:07 AM

Figure 2 Tip window. file:///d /VIT_WSIPL/HowVisualCPP.htm (2 of 17)1/31/2004 6:56:07 AM

Figure 3 Visual C++ with blank project workspace. 3. Click pull-down menu File, shown in Figure 4, and then New to create a new project, if you never create before, or you want to create another project. A new window with tab menus shows up. There are five tab menus including Files, File Wizards, Projects, Workplaces, and Other Documents. Make sure you go to Projects menu (Figure 5) by click tab of Projects. Figure 4 Create new project. file:///d /VIT_WSIPL/HowVisualCPP.htm (3 of 17)1/31/2004 6:56:07 AM

Figure 5 Project tab menu. 4. In Projects Menu, select Win32 Console Application; locate your disk place in which you can save your project, shown in Figure 6. Make sure input project name. For example you can type the project name as CourseProject, as displayed. Now Visual C++ automatically creates a directory or folder which has project named CourseProject. After you click OK button and click Finish button to close the Win32 Console Application Wizard window, shown in Figure 7 and OK button of New Project Information window, shown Figure 8. The project name share with the folder name, in which project file is saved. Then Visual C++ opens a new Workspace for you, shown in Figure 9. file:///d /VIT_WSIPL/HowVisualCPP.htm (4 of 17)1/31/2004 6:56:07 AM

Figure 6 Locate the folder in which your new project can be saved. file:///d /VIT_WSIPL/HowVisualCPP.htm (5 of 17)1/31/2004 6:56:07 AM

Figure 7 Win32 console application wizard window. file:///d /VIT_WSIPL/HowVisualCPP.htm (6 of 17)1/31/2004 6:56:07 AM

Figure 8 New Project Information window. file:///d /VIT_WSIPL/HowVisualCPP.htm (7 of 17)1/31/2004 6:56:07 AM

Figure 9 Workspace with new project. 5. If you haven t had a C/C++ code, you can use Visual C++ s text editor to type one. IF you have a c/c++ file already save somewhere in your computer or disks, you do not need to create C/C++ file. Now let assume you do not have the C/C++ file or you want to create a new C/C++ program. You can type your C or C++ code, you can click New Text File under the File Menu (Figure 10) to open a new editor window for you to type or edit your source code. Let s type the following simple C or C++ code. C code C++ code file:///d /VIT_WSIPL/HowVisualCPP.htm (8 of 17)1/31/2004 6:56:07 AM

#include<stdio.h> int main() { printf("i am learning C now!\n"); return 0; } #include <iostream.h> int main() { cout << "I am learning C++ now!\n"; return 0; } Figure 10 Click to open text editor file:///d /VIT_WSIPL/HowVisualCPP.htm (9 of 17)1/31/2004 6:56:07 AM

6. After you accomplish your code type, click File, Save as to save your C or C++ source code (Figure 11). Visual C++ will open a window for you to save. Type the name of your C or C++ source code. For example, code01.c for C code and code01.cpp for C++ code. Note: step 5 and 6 can be avoided if you already typed your source code using Notepad, Word, or other word processing editors. In other words, you can create C++ source code using any editing software. For example, you can download codes from internet or copy example codes from CD or disk associated with textbooks. file:///d /VIT_WSIPL/HowVisualCPP.htm (10 of 17)1/31/2004 6:56:07 AM

Figure 11 Save your code in your computer somewhere. Figure 12 Save As window to save your code. 7. Even though you typed the code. It does not mean you have load the code in the project file:///d /VIT_WSIPL/HowVisualCPP.htm (11 of 17)1/31/2004 6:56:07 AM

you have opened. You can save your code inside the project folder. That doesn t mean you load the code in your project. This is very important note. Now you need to add your source codes (say code01.cpp) to the project. Go to pull-down menu Project, Click Adds to Project, then Files. Visual C++ will open a window called Inset Files into Project (Figure 13). Find out whether C or C++ source code has been add to your project or not. Then click OK button to insert it to the current project called code01.cpp, shown in Figure 14. You can go to Workspace window and click FileView, then click + in front of CouresProject files and + in front of Source files, you will find your source code, code01.c or code01.cpp. Double click code01.c or code01.cpp will open the editor window for you to modify the source code, if it has bugs. Figure 13 Add your code into the project you open. file:///d /VIT_WSIPL/HowVisualCPP.htm (12 of 17)1/31/2004 6:56:07 AM

Figure 14 Select code to be added to the project. file:///d /VIT_WSIPL/HowVisualCPP.htm (13 of 17)1/31/2004 6:56:07 AM

Figure 15 Open added code for editing. 8. Now it is time for you to compile, link it by clicking pull-down menu, Build, then Build Code01.exe. Or press F7 key. file:///d /VIT_WSIPL/HowVisualCPP.htm (14 of 17)1/31/2004 6:56:07 AM

Figure 15 Compiling status window. 9. If no error message reported, you can execute it, by clicking pull-down menu, Build, then Execute code01.exe (or press Ctrl+F5). file:///d /VIT_WSIPL/HowVisualCPP.htm (15 of 17)1/31/2004 6:56:07 AM

Figure 16 Execute code. 10. Visual C++ brings you a DOS console window in which your computational outputs are displayed. Press any key to exit the window. You have done the job. See Figure 17. Figure 17 Result in Win 32 console window. 11. If you want to compile your source code only, you can go to Workspace window to open the editing window as mentioned in step 7. Click Build, then Compile code01.cpp (or press Ctrl+F7 key). file:///d /VIT_WSIPL/HowVisualCPP.htm (16 of 17)1/31/2004 6:56:07 AM

12. After you accomplish your current project, make sure save the whole project by clicking File then Save ALL. Then go to File, then Close Workspace. 13. If you want to open your existing project, you go to File, then Open Workspace.Visual C++ brings you a Open Workspace window. Go to CoureProject folder and double click CourseProject.dsw. Note: The procedure is exactly the same for C and C++ programming. file:///d /VIT_WSIPL/HowVisualCPP.htm (17 of 17)1/31/2004 6:56:07 AM