- Intro
- Basics
- Compiling your first program
- Structure of a program
- Comments
- A first look at variables (and cin)
- A few common C++ problems
- A first look at operators
- A first look at functions
- Whitespace and basic formatting
- Forward declarations
- Header files
- Programs with multiple files
- A first look at the preprocessor
- Variables
- IDE
- Operators
- Variable
- Control Flow
- Array
- Functions
- OOPS
- Overloading
- Composition
- Inheritance
- Programs
Before we will start to develop some programs
keep in mind the following two things:-
1.
We are going to develop C++ program so
always save the program with .cpp extension.
2.
We will develop console programs means
there will be no graphics user interface will be developed to interact with our
program(because GUI interface development will go so complex and the basic
concept will not be understandable to you).
So now create a new project in Visual
Studio by following these steps:-
New -> Project. A
dialog box will pop up that looks like this
Select the Win32 project type, and Win32 Console Application will
automatically be selected for you. In the Name field, you will
enter the name of your program. Type in HelloWorld. In the Location field, pick a directory that you
would like your project to be placed into. We recommend you place them in a
subdirectory off of your C drive, such as C:\VC2005Projects. Click OK, and then Finish.
On the
left side, in the Solution Explorer, Visual Studio has created a number of
files for you, including stdafx.h, HelloWorld.cpp, and stdafx.cpp.
In the text editor, you will see that
VC2005 has already created some code for you. Select and delete the _tmain
function, and then type/copy the following into your compiler:
#include "stdafx.h"
#include <iostream>
int main()
{
std::cout << "Hello
world!" << std::endl;
return 0;
}
Subscribe to:
Post Comments (Atom)
0 comments: