MICROSOFT VISUAL C++ 2008 TUTORIAL

Posted by Didi Setyapramana On 8:54 AM 0 komentar

INTRODUCTION
Microsoft (MS) Visual C++ allows you to create many different types of applications written in the C++ programming language. It is part of MS Visual Studio 2008, which allows software developers to develop software applications in several programming languages including C++. This guide addresses creating and using C++ Console Applications. A console application is a computer program that enables a user to interact with a computer via a keyboard and display screen. The application runs inside a DOS window. This guide is divided into the following sections:

Starting Visual C++

Creating and Executing a Single-File Console Application

Importing and Executing C++ Source Code Files


STARTING MS VISUAL C++

To start the MS Visual C++ compiler, click the Start button on the task bar to open the start menu. Open the Programs menu (All Programs in Windows XP). Select Visual Studio 2008, then select Microsoft Visual Studio 2008, and finally select the program Microsoft Visual Studio 2008. If the MS Visual Studio window is not maximized, click the maximize button in the upper right corner of the title bar.
Figure 1



 Figure 1 Microsoft (MS) Visual Studio


Figure 1 shows the initial application window. If your application window looks different, you may need to adjust the settings. You need to change to the Visual C++ Development Setting. You can change the settings by clicking the Tools menu and selecting Import and Export Settings. Select the Reset all settings option and click Next twice. Then, you will see a dialog where you choose a default configuration as shown in Figure 2. Select Visual C++ Development Settings and press Finish. Finally, you will close the Reset Complete dialog box. If this is the first time you’ve run Visual Studio, you will be shown the Choose Default Environment Settings dialog similar to Figure 2. Select Visual C++ Development Settings and press Start Visual Studio.
Figure 2










Figure 2 Choose default environment settings

CREATING AND EXECUTING A SINGLE-FILE CONSOLE APPLICATION

One of the most common programs encountered in an introductory C++ programming class is a single source code file that contains the main function. To construct this type of application, you need to:


  • Create a Win32 Console Application 
  • Project Add a source code file 
  • Write the program 
  • Execute the program
  • Debug the program
Create a Win32 Console Application Project


Start Microsoft Visual Studio 2008. On the File menu select New, then Project.
When the New Project dialog box opens (Figure 3), click on the + beside Visual C++ in the Projects Types pane, then on Win32. In the Templates pane, select Win32Console Application. Enter the following information (see Figure 3):
Enter the project name in the Name textbox
Select the location for the project in the Location textbox
Remove the checkmark beside Create directory for solution





Figure 3 New Project Settings


The application provides a default location for saving projects or you can select your own location by pressing the Browse button to the right of the location textbox to open the Choose Directory dialog box.
Press the OK button after entering the required information into the dialog box. When the Win32 Application Wizard appears, click on Application Settings, select Console application from the Application types and check Empty project (see Figure 4) and then press the Finish button. The Solution Explorer now contains the information about your project (see Figure 5.) Note how the Start Page now has your project listed. This will be a shortcut to starting the project the next time you run Visual Studio.

Figure 4 Win32 Console Application Wizard



Figure 5 Empty Win32 Console Application (with Start Page)

0 Response for the "MICROSOFT VISUAL C++ 2008 TUTORIAL"

Post a Comment