Author | Message | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ![]() 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.//
-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.
#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.
#include <iostream> using namespace std; int main () { cout << "Hello World!"; return 0; } Then just Build&Run it.
|
| ![]() Good tutorial mate. :) --- ...
|
| ![]() Nice, this should help beginners. --- You're all fags.
|
| ![]() I'm re doing the explanation part to put it in a more detailed manner.
|
| ![]() Looking better. I'd suggest one more thing now though. Use "Preformatted" from the [Style] menu. --- I am an alien and not crazy!
|
| ![]() Pretty good tutorial.
|
| ![]() Desmond Taylor posted: (11th Jul 2011 07:29 pm) Thank you everyone. Desmond: I use that option from the Full Code right? xD because that's what I did.
|
| ![]() 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!
|
| ![]() Desmond Taylor posted: (11th Jul 2011 10:08 pm) Right, right. Heartless bastard :P --- http://www.addipop.com
|
| ![]() :P --- I am an alien and not crazy!
|
| ![]() Any suggestions for my next guide?
|
| ![]() Thanks for the guide.
|
| ![]() Kaylinz posted: (12th Jul 2011 05:00 pm) 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?
|
| ![]() DanScott posted: (13th Jul 2011 08:28 pm)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.Kaylinz posted: (12th Jul 2011 05:00 pm)
| |