EOSERV Forum > Lounge > C++ Tutorial(Hello World)
Topic is locked.
Page: << 1 2 >>
C++ Tutorial(Hello World)
Author Message
Post #87434 C++ Tutorial(Hello World)

            C++ Tutorial("Hello World")

Why hello everyone I'm just going to cut the crap and start the guide.

Well today I am going to show you how to get Codeblocks and make your first console Application.//


  • The first step is installing Codeblocks: HERE

  • Installing it just do: Next->I Agree->Next->Install and allow it to Install

  • One it is done installing it's time to launch Codeblocks... So launch it :p

-Once you launch it goto File->New->File...

-Choose C/C++ Source and click Next until you get to naming it.

-Click on the "..." button and name the file main.cpp and save it to your Desktop.

-It should then open up main.cpp now time for the coding part xD.

  • Programming Section(explanation):

#include <iostream> - The "#include" part of the line is including the library "<iostream>". The "<iostream>" part is a header file which is used for input/output in the C++ programming language.


using namespace std; - keeps you from having to type std::cout each time you want to display a output on the console it always ends with a ";".


int main() - his line corresponds to the beginning of the definition of the main function. The main function is the point by where all C++ programs start their execution.


"{" - Starting bracket for the main code.


cout << "Hello World"; - 'cout << "" ' takes the text which is contained in the ""and outputs it on the console screen. it end's with a ";".


return 0; - The "return" statement causes the main function to finish. return may be followed by a return code.It is followed by the return code with a value of zero.


} - The end bracket finishes the main code.

  • Full Code for Newbs:

           #include <iostream>
        using namespace std;

              int main ()
             {
                cout << "Hello World!";
                return 0;
              }

Then just Build&Run it. 

13 years, 43 weeks ago
Post #87435 Re: C++ Tutorial 1(Hello World)

Good tutorial mate. :)

---
...
13 years, 43 weeks ago
Post #87441 Re: C++ Tutorial 1(Hello World)

Nice, this should help beginners.

---
You're all fags.
13 years, 43 weeks ago
Post #87443 Re: C++ Tutorial 1(Hello World)

I'm re doing the explanation part to put it in a more detailed manner.

13 years, 43 weeks ago
Post #87444 Re: C++ Tutorial(Hello World)

Looking better. I'd suggest one more thing now though. Use "Preformatted" from the [Style] menu.

---
I am an alien and not crazy!
13 years, 43 weeks ago
Post #87446 Re: C++ Tutorial(Hello World)

Pretty good tutorial.

13 years, 43 weeks ago
Post #87448 Re: C++ Tutorial(Hello World)
Desmond Taylor posted: (11th Jul 2011 07:29 pm)

Looking better. I'd suggest one more thing now though. Use "Preformatted" from the [Style] menu.

Thank you everyone.


Desmond: I use that option from the Full Code right? xD because that's what I did.


13 years, 43 weeks ago
Post #87465 Re: C++ Tutorial(Hello World)

Yes and now you got the deserved +1 :P I would have done that myself but I was watching TV as you know :P

---
I am an alien and not crazy!
13 years, 43 weeks ago
Post #87477 Re: C++ Tutorial(Hello World)
Desmond Taylor posted: (11th Jul 2011 10:08 pm)

Yes and now you got the deserved +1 :P I would have done that myself but I was watching TV as you know :P


Right, right. Heartless bastard :P
---
http://www.addipop.com
13 years, 43 weeks ago
Post #87533 Re: C++ Tutorial(Hello World)

:P

---
I am an alien and not crazy!
13 years, 43 weeks ago
Post #87583 Re: C++ Tutorial(Hello World)

Any suggestions for my next guide?

13 years, 43 weeks ago
Post #87671 Re: C++ Tutorial(Hello World)

Thanks for the guide. 

13 years, 43 weeks ago
Post #87799 Re: C++ Tutorial(Hello World)
Kaylinz posted: (12th Jul 2011 05:00 pm)

Any suggestions for my next guide?


Variables, and maybe an explanation of the string variable in so far as how it's an 'array' of 'char' so people understand arguments[0] or w/e - that's just what I found one of the hardest things to understand when I went into C++ development when I was like ...12? Lol god knows why I did that from such an early age >.<
---
If money doesn't grow on trees, then why do banks have branches?
13 years, 42 weeks ago
Post #87801 Re: C++ Tutorial(Hello World)
DanScott posted: (13th Jul 2011 08:28 pm)

Kaylinz posted: (12th Jul 2011 05:00 pm)

Any suggestions for my next guide?


Variables, and maybe an explanation of the string variable in so far as how it's an 'array' of 'char' so people understand arguments[0] or w/e - that's just what I found one of the hardest things to understand when I went into C++ development when I was like ...12? Lol god knows why I did that  forum such an early age >.<
You make a point on how hard it was but I doubt any twelve year old boys will read the guides I make due to the fact that they can't even compile properly. I might actually make a guide of this.

13 years, 42 weeks ago
Post #87842 Re: C++ Tutorial(Hello World)

[like]

Srsly this is awesome, are you adding all your guides to wiki? You really should. 

---
http://www.ctronic.ga
http://www.tsu.co/Deltro
https://www.reverbnation.com/deltro9
13 years, 42 weeks ago
Page: << 1 2 >>
Topic is locked.
EOSERV Forum > Lounge > C++ Tutorial(Hello World)