Search here

Sunday, February 6, 2011

Learn C++ computer programming basic tutorial with Microsoft C++ 2010 edition

In this blog i will show you he basic tutorials for learning C++ program with Microsoft Visual c++

What is C++?

Unlike other programming language, C++ needs a compiler to compile and run the program. There are many C++ compilers such as Microsoft visual C++, Borland C++, Dev C++ etc. you can choose anyone you like. But I am going to recommend Microsoft Visual C++ 2010. You can download it from the internet freely.

Downloading and installing compiler:
You can download Microsoft Visual C++ 2010 from this link                               
Then download Visual C++ and install it in your computer. You can also use Visual C++ 2008.

Setting for C++ Programming:
After installing Visual C++, start the Visual C++2010 from desktop shortcut or go to   Start >> All Programs >> Microsoft Visual C++ 2010 Express Edition          
A screen will pop up as Figure 1.     


Then to create a new program, go to File >> New>> Project, then a diagnose box will open as shown in Figure 2.


Make sure that you click on Win32 and Win32 Console Application. Write the project name and click OK.

Click Next after this diagnose box pops up. (Figure 3)

After clicking Next this diagnose (Figure 4) box will pop up. Make sure that Console application and Empty Project age checked. Then click Finish.

After that go to the "Solution Explorer" on the left side and right-click on the project name (that you gave before). Once you have right clicked on project name select      Add>>New Item or simply press Ctrl + Shift + A.

On the top select C++ File (.cpp) and enter a name and click Add. After clicking add your Microsoft Visual C++ 2010 will look like Figure 6 and you are ready to write your program


Writing first program: (Hello World)
Now inside the blank screen just write the following syntax.
#include <iostream>
using namespace std;
int main ()
     cout <<"Hello World";

Then simply press Ctrl + F5.

Most of your programs should have the first three lines. Anything that you want to change should be between the “{----}”. In the above program, the word count refers to printing on the black screen.    

You can check the C++ Basic tutorial part 2 about Variable in this link - Just Click here

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.