C++ Tutorial 1, Introduction to C++


Visitors: 643

Introduction to C++

Why Learn C++?

C++ may at first seem like a boring, confusing programming language that you can only program command prompt applications with. Well, that is what it is like in the [b]begining[/b]. And you are going to need to learn the basics like this with any programming language. As you get better and progress in your C++ skills, you will begin to learn that you can start making some cool applications easier than you thought you could. The main reason to learn C++ though, is that it teaches all the basics of programming and you will learn concepts that will be used in other types of programming. Many other programming languages are like C++ or use C++. For example, PHP, a powerful web development language uses almost the same syntaxes as C++. DirectX, a common game development graphics library primarily uses C++.

Setting up C++

Ill assume that most people are not going to want to spend the money for a compiler, thats fine, there are many great free compilers. I use Dev-C++ because it has some nice features and is fast, and best of all, its FREE!


You can download it here. Download it and install it, this step is pretty easy. During instillation, select all the deafult values during instillation.

Create a New Project:
Go to the top menu: File -> New -> Source File, or just press Ctrl+N

You should now have a text document. Then, write the following text in the document:


using namespace std;

int main() {

cout<<"Hello World!";

cin. get(); }

I would suggest typing it instead of copying it, you will get alot more out of actually typing it rather than copying it, because you get used to the syntaxes and development.

Run the Application:
Now that you have your first C++ Application, [b]Press F9 [/b] to compile and run it. If you did everything right, it should open a command prompt like application and say ‘Hello World’ or whatever you told it to say. If it doesnt, look over the code and make sure everything is correct.

Code Analysis

Tells the compiler that we are going to be using the iostream library, which includes information on things we will be using in the code.

using namespace std;
Saves time by telling the compiler that we are going to be using the ‘std::’ functions, which stands for ‘standard’.

int main()
Starts the main function, this is were the heart of the program is. I will get into what functions are later on.

{ Starts the main function.

cout<<"Hello World!";[/code] Writes “Hello World!" to the screen. cout stands for ‘console output. '

cin. get();[/code] Gets a variable from the user, we wont really be using this, but it is what will keep our application from being closed really quick.

} Closes our main function.

Now that we have made a simple C++ Application, we will start getting into more advanced topics so you can start making useful applications.

Chris Silop - http://www.syschat.com Computer Forum


Article Source:

Rate this Article: 
Web Design A Brief Tutorial
Rated 4 / 5
based on 5 votes

Related Articles:

Network Certification Exam Tutorial: An Introduction To Backup Types

by: Chris Bryant (October 07, 2006) 
(Computers and Technology)

CIsco CCNP / BSCI Exam Tutorial: Introduction To Policy Routing

by: Chris Bryant (March 31, 2006) 
(Computers and Technology/Certification Tests)

Cisco CCNP Certification / BSCI Exam Tutorial: An Introduction To BGP

by: Chris Bryant (May 08, 2006) 
(Computers and Technology/Certification Tests)

FSX Tutorial Flight Simulator Virtual Airlines Tutorial

by: Richard Myers (January 20, 2011) 
(Computers and Technology)

Blogging Tutorial

by: Steve Dimeck (August 31, 2005) 
(Internet and Businesses Online/Blogging)

The Flash Tutorial

by: Justin Grover (October 25, 2005) 
(Internet and Businesses Online/Web Design)

Podcasting, a Tutorial

by: Hans Dekker (September 22, 2005) 
(Internet and Businesses Online/Podcasting)

Machine Applique Tutorial

by: Janet Wilke (July 08, 2008) 
(Home and Family/Crafts Hobbies)

C++ Tutorial 2, Input and Variables

by: Chris Silop (March 25, 2005) 
(Computers and Technology/Software)

Web Design A Brief Tutorial

by: Giancarlo Matturi (July 21, 2008) 
(Internet and Businesses Online/Web Design)