Join Us.


Member Login

Not a member? Sign Up for Free.
Want to help RottenEggs? Do your part and share this site
  • Edit
  • View Story
  • Comments
Home All Stories Story

“ Basic C++ Tutorial ”

Story by , written 14 years ago 2459 views126 votes
DO NOT TRY THIS AT HOME : Text files and message bases are for INFORMATIONAL PURPOSES ONLY. Do not undertake any project based upon any information obtained from this or any other web site.We are not responsible for, nor do we assume any liability for, damages resulting from the use of any information on this site.
Hello all people of RE.. I am Dist719. I have searched for any C++ guides in the database and maybe people tried and didnt get accepted, but I hope maybe mine will.

(For all people that know alot more about coding with this than me please keep all bad comments to yourself, this is directed torward people who dont know and maybe want to get into it. thx)

NOW, to learn a little about C++, it is originated off of the coding language \\"C\\" and is made to make video games and other such programs (Ex. World of Warcraft, Guild Wars, ect.) C and C++ are used for two different things.. But really I havent learned too much about that, But anyway, In this tutorial I will teach you how to make the basic programs like DOS boxes and thigns like that.

Step One: You need a download. It is not a virus or any spyware trojan blah blah blah, It is a C++ compiler which transmits your code into a program. It is called Dev-C++, and this is the link for the download:

Now I suggest getting Dev-C++ 4, because 5.0 is currently in beta right now and might have alot of bugs, But if you want to get it, go for it.
The download should take about 4-5 a minute, its only 7.81MB When its done extract and set it up.

Step Two: Installing it shouldn\\’t be a problem, Just download it like anything you would download, Agree, Next, Next, Next, Finish, and your done. Double Click that and you\\’ll Get some Popups saying how you want to configure the program. On the first popup make sure all the boxed are checked, and set the icon style for your liking. After that your program should open up and your SET.

Step Three(A):
Now, you have your program and your ready to learn some coding. The first thing you do is go up to \\"File\\" (Top left corner where it always is) and then click \\"New Project\\". Now a window will pop up and it will say what you want running this project and what coding it will use. FOR NOW click on the \\"Console Application\\" (DOS box) and at the bottom in the radio dots, make sure C++ is clicked. Now, Name it whatever you want.

So, When you look at it there is already typed things in the box, and its no use. Delete all of it and now your ready to start.
Step Three(B):(Learning the code)
You\\’re finally done with the boring setup and your ready to start!

1). In Noobish programs, like making DOS boxes and such, The first thing you would put on the first line is:

Now, to people new to coding they would think well what does that mean. Well, That program is telling the computer to use a standard library file which is basically the file where some C++ commands are, so the computer can understand what it is. For advanced people, they would include alot more.

Now, after your inclusion you want to put:
using namespace std;

C++ uses namespaces to organize names that are different, into programs. Every name used in the iostream stansary library file is in the namespace called, std. (And if your experienced in any coding, the semicolon after it just means another command is coming after it)
Next, is to state your function. Which would be typing this:
int main(void)
Now.. functions are kinda hard to explain for me but lets just say int main is initializing the main function, which is a space where commands are put.

So right now our program has:
using namespace std;
int main(void)

So, now your are going to make some commands. Under \\"int main(void)\\" you want to put a bracket.
int main(void)

Now, in the bracket you are going to put your function.
A simple command (and what everyone uses their first time with C++) is the \\"cout\\" command. (Pronouced C-out) Now cout means that you are going to show text on something. cout is basically sending out text to the program. Now, how to use this Cout command:
cout (two \\"less than\\" signs) \\"Hello\\";

and you need a \\"return 0;\\" at the bottom so it doesent close automatically.
So you should end up with this:
using namespace std;
int main(void)
cout (Two \\"less than\\" signs) \\"Hello\\";
Return 0;

Now, That is the most easiest program out there (probably). To start the program go to the top of the program window and click execute. If there is ONE PROBLEM it will not run. The code has to be perfect. When you execute it, a DOS box will pop up saying whatever you but in the \\"cout\\" command.

Thank you for reading this, and I know it may not be the best egg, I know there is no pictures and maybe some things are spelled wrong.. but please if you have any questions message me or comment on here, Please do not rate bad because there are no pictures, I tryed to cover that up by putting alot of detail. THIS IS for people who dont know C++ and to get them started, if your really good dont flame on me. Thank you all.


  • Attach Image
This is where new messages will appear. Type something into the box above to start sharing.

Related Groups