Discounted Software Products        Web Hosting. 30% off coupon: vip30bw     Free File Hosting - up to 5GB

New to c++ ? Start here

Do you know C++ ?
You've come far through the coding age and all the crappy other things and made it to the top ! Talk here about C++

New to c++ ? Start here

Postby bigsnake » Sun Jan 24, 2010 11:57 pm

Hello and welcome to the new C++ Section !!

In this thread I will teach you a basic code you can do in c++

O.K, first off you may want to start off by downloading c++, also know as "Visual Basic C++ Express". Google it, you will find it

O.K have you downloaded it ? Good

1) To start off with we are going to make a new win32 console application so start up "Visual c++ Express" and click on new project or go to File -> New -> Project

2)Select "Win32 Console Application" and for the name type in Hello World ! and press ok


O.K now you will get a new project come up, on the left hand side should be the "Solution Explorer". Right click on "Source Files" and click Add -> New Item
Select "c++(cpp)" file from that list, set the name to "main" and press ok.

You will now have the main.cpp up, if not double click on the main.cpp in the Solution Explorer

The Code

First off we are going to tell c++ to include the "iostream" so type the following code

Code: Select all
#include <iostream>


O.K so we've loaded the "iosteam" but what now ?

Lets save some time by adding this line :

Code: Select all
using namespace std;


Now, "STD" means standard and puting in this code will save us some time later on, I will explain it when we get there

Lets do the main code :

Code: Select all
int main()
{
   cout << "Hello World" << endl;
   return 0;
}


Now, normally before "cout" and "endl;" we would have to put "std::" before it but since we put a "Namespace" ealier c++ will then know where the "std::" has to go

The code is completed ! But we still have something to do :

Click on Debug -> Start without Debugging or press Ctrl+F5 for a shortcut

You should be promt with a window which nags about it not being compiled, just ignore it and click on yes, it will compile and a CMD window will open saying "Hello World" in

Enjoy coding your own programs :)
I am the almighty, I am week but what makes me strong is my snake, ATTACK !
bigsnake
Site Admin
Site Admin
 
Posts: 80
Joined: Sat Jun 20, 2009 7:38 pm
Location: England, also BEHIND YOU WITH A FLAMEFROWER !
What brings you to FPSC world ?: Other

Return to C++

Who is online

Users browsing this forum: No registered users and 0 guests

cron

Aannemer     Unieke Ringtones     wegwerpemail    Gratis daghoroscoop   Jouw Daghoroscoop Jouw Jaarhoroscoop jouw chinese horoscoop Anoniem Surfen uurl.nl-verklein je url GSM Wallpapers Vliegvakanties Simlock Vrijmaken Limewire Downloaden Alle Radiozenders Sony Laptop Dutchleaderbux.nl

MultiForums powered by echoPHP phpBB MultiForums