★ TouchArcade needs your help. Click here to support us on Patreon.

c++ tutorial section

05-27-2009, 07:33 PM
Joined: Jan 2009
Posts: 1,099
c++ tutorial section

hoping some of you will contribute(mr croc)

Current faves:UniWar,Glyder, Assasin's Creed, Wolfenstein,Zenonia(beta testing)
☻/ my review site:cheatcodes4chicos
/▌reviewer at: appmania
/ \ There you go rocketman I've moved on from hobocity
05-27-2009, 08:12 PM
ok, ill do what i can.

im on a pc, never used a mac yet. first youll need a compiler, i use MS visual studio which wont make a difference with what im saying other than 1 or 2 things if youre on a mac, i think there will be GNU or GCC for the mac, making projects and compiling will differ, perhaps someone else could chime in with what you would need to do different.

the compiler is a handy program which takes our easy to use high level language (c++) and breaks it down into data the pc can understand.

so assuming your on pc and have MS visual studio up and running.

file->new->project and select win32 console application
(this just means when you run, it runs on a pop up screen whilst windows is running)
then when youve selected ok, another screen will pop up, select application settings, select empty project, and make sure console app is ticked
right click on source files in solution explorer and select "add new item"
select to add a new .cpp file

now type in

#include <iostream>
using namespace std;
void main()
	//the following prints out "hello world" to screen
	cout << "hello world" << endl;
then build and run. a pop up screen should come up saying "hello world"

this is the hello world program for c++. getting to this stage is 1/2 the battle so after you or anyone else has gone through it ill go through exactly what the code means, then introduce the next thing which will build upon this program.

if it helps much, you wont need to understand anything up to "void" for a long time, and anything which has // in front isnt code, its just comments.
05-28-2009, 09:58 AM
Joined: Mar 2009
Posts: 22
05-28-2009, 08:50 PM
perhaps the best thing would be to go through some of those tutorials then post back here if you get stuck or would like more in depth info, or if you want the ame thing explained in a different way (that always helps me)

my tip is bear in mind the whole point of c++ is to create your own optimal high level language, so youll end up with code like


so when your stuck in a tutorial, think about how you can accomplish this style of personalised code.