Results 1 to 14 of 14
  1. #1
    Drew's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    C:\Users\Drew
    Posts
    312
    Reputation
    66
    Thanks
    49

    Deebow's C++ TuT #1---for beginers! How to make your first program!

    MODS if theres a way I could be aloud to post a link to the bloodshed site so people can download Dev-C++ please tell me!


    Im going to teach you all how to make a simple program with C++.

    This TuT is for people who have never used C++ or Coded ever and wish to start!

    First you will need to Download and install Dev-C++. It is a program used to write programs then convert them into actual executable programs. I had trouble and could not post the installer as an attatchment
    Search for "bloodshed Dev-C++" and you should find it... Sorry im afraid to post any links as I dont wanna get banned and the stupid attatchment thing didnt work. You can pm me if you need a link
    You can also search the web for a C++ compiler and use any program you want. I use Dev because it is easy to use and all the pictures in this TuT are from Dev so I reccomend using it. After you download Dev-C++ (or whatever compiler you wish to use) install it.

    Now open up Dev-C++ and go to New>Source file.


    What looks like a text document shoud open in the blank spot there. This is where your going to write the code for your program.

    Code:
    // Your first program in C++
    
    #include <iostream>
    using namespace std;
    
    int main ()
    {
    char *enter;
    cout << "Hello World!\n";
    cout << "You just made your first C++ Program!\n";
    system("pause");
    }
    Copy and paste that into your new document in Dev-C++.( Looking at this code and typing it in yourself will help you learn better!)

    After you type it in (Or copy/paste -.-) It should look like that.

    Now that you have your code in there you need to compile it! Go to Execute>Compile, click compile and a little window should pop up and ask you what you want to name your compiled program, Name it whatever you want .


    After you compile it you can run it. The run option is in the same spot as the Compile one but heres another screenshot just in case you get lost


    When you click run a CMD (Black box thing -.-) will pop up and it will tell you "Hello world!" "You just made your first C++ program!" As you can see in the code. Then you press any key and the CMD will close.


    Tah Dah!!! You are on your way to becoming a C++ Coder! Now if you want to learn more besides just copy and pasting I will define those commands for you!

    Code:
    // Your first program in C++
    That is a comment! Any line beggining with // is only for you to read and will not effect the code or program!

    Code:
    #include <iostream>
    This is a preprocessor directive. They always start with the # sign and it comes before any code to tell the processor what it is going to need to do. This tells the compiler to include the iostream header file which contains the cout function and standard input/output functions.- Zhao


    Code:
    using namespace std;
    This is used often used for more advanced C++ such as input/output and such. It is not really needed in this code but It fixes some errors that might occur so I usually use it.You will learn more about this later in C++.

    Code:
    int main ()
    This tells the processor that the Following Code is the Main code of the program.

    Code:
    {
    Opens the code, everything under this is a code for the program to run.

    Code:
    char *enter;
    Also not really needed in this simple program but it also fixes some errors that might occur so I reccomend keeping it.You will learn more about this later in C++.

    Code:
    cout << "Hello World!\n";
    This is a statement. Its what makes those magical words appear. Cout is what tells the processor that there is a statement coming up. << Has something to do with displaying the words . Cout and << are new features of the C++ language.

    Code:
    cout << "You just made your first C++ Program!\n";
    This is a statement. Just as above. You can have as many statements as you want.

    Code:
    system("pause");
    This is what makes the program say "Press any key to continue" so you can close it when you are done. It also makes the program stay open because without it the program would display the statements and close.

    Code:
    }
    End of code.

    I hope you found this TuT useful and maybe I have created some future interest in coding for some of you

    I plan to make more C++ Tutorials as I learn more myself.

    If you have any problems post here I will help you!

    Dont forget that handy dandy thanks button?
    Last edited by Drew; 08-02-2009 at 10:52 AM.



    Proud member of MPGH since 2009

  2. The Following 13 Users Say Thank You to Drew For This Useful Post:

    caelkai (12-28-2011),Cervino5 (08-31-2011),dzan78 (08-09-2010),ElitePk (08-03-2009),fcmclan (08-03-2009),jessehotmail (03-23-2011),n1kko (08-02-2009),nandorb (08-02-2009),ratnetworks (12-28-2009),souljaowner (08-14-2009),trex (08-01-2009),why06 (08-02-2009),Wolf (08-02-2009)

  3. #2
    trex's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    In a house in AUSTRALIA FTW!!!
    Posts
    683
    Reputation
    16
    Thanks
    84
    My Mood
    Amused
    Nice. I might try this out soon. I have never done anything with coding so its totally weird to me.
    [IMG]https://i415.photobucke*****m/albums/pp231/TREXOX/Signature02.jpg[/IMG]

  4. #3
    zhaoyun333's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    396
    Reputation
    11
    Thanks
    1,125
    Noob friendly =D CMD = command prompt
    Your tut needs a little fixing up.

    Code:
    #include <iostream>
    This tells the compiler to include the iostream header file which contains the cout function and standard input/output functions

    Code:
    using namespace std
    This is the standard namespace, without this you would have to do
    Code:
    std::cout<<"Hello Wordl!";
    So its for lazy coders
    Code:
    cout<< "Hello World!\n";
    This outputs Hello World to the screen. The '\n' character makes a new line, but it cna be substituted by this:
    Code:
    cout<<"Hello World!<<endl;
    endl is a macro for new line;
    Code:
    system("pause");
    System(" ") actually means anything in the brackets will be treated as a command line. If you know your command prompt commands you can put it in the brackets. Try typing in "pause" without the quotations into command prompt
    There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi

  5. The Following User Says Thank You to zhaoyun333 For This Useful Post:

    why06 (08-02-2009)

  6. #4
    killerld's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    345
    Reputation
    11
    Thanks
    193
    My Mood
    Twisted
    Zhao is always there to find error :P And I think he's always able to find one XD But nice job for the TuT


    Sorry for my bad English ! I'm French Canadian !

    - When you use my hack, Please Thank Me

    Release some Hacks []
    Able to code in PhP / Mysql []
    Able to code in VB []
    Able to code in C# []
    Able to do VB Injector []
    Release an Injector []
    Active Member in the Community []
    Member who help small Hacker []

  7. #5
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Nice Tutorial Deebow and thx for the folow up zhao.

    BTW: what I don't understand the "namespace std" thing? Seems like it is there just for the hell of it o_O?

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  8. #6
    Drew's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    C:\Users\Drew
    Posts
    312
    Reputation
    66
    Thanks
    49
    Using namespace std

    Is like zhao said. With it you can simply put

    cout << "hi" << endl;

    but without it you have to put

    std::cout<<"hi";



    Proud member of MPGH since 2009

  9. #7
    n1kko's Avatar
    Join Date
    Jan 2009
    Gender
    male
    Location
    MPGH.net/DayZ
    Posts
    2,432
    Reputation
    105
    Thanks
    459
    My Mood
    Devilish
    Thanks! I found this very easy to follow, this is a great Tut, and i look foward to viewing your future tuts.
    Quote Originally Posted by Dave84311 View Post
    I can ban you for whatever reason I want, ******.

    Banned for being a ******.




  10. #8
    Wolf's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    666
    Posts
    12,423
    Reputation
    286
    Thanks
    1,158
    you can do tht in notepad if u save it as .bat good tut anyway lol

  11. #9
    n1kko's Avatar
    Join Date
    Jan 2009
    Gender
    male
    Location
    MPGH.net/DayZ
    Posts
    2,432
    Reputation
    105
    Thanks
    459
    My Mood
    Devilish
    deebow, make a tut for writing dll files.
    Quote Originally Posted by Dave84311 View Post
    I can ban you for whatever reason I want, ******.

    Banned for being a ******.




  12. #10
    Drew's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    C:\Users\Drew
    Posts
    312
    Reputation
    66
    Thanks
    49
    Yeah I made this guide so that anyone could understand it. I hate guides that expect you to know things, Like longevitys d3d9 chams tutorial... Its like making a golf guide that only Tiger Woods could understand...



    Proud member of MPGH since 2009

  13. The Following User Says Thank You to Drew For This Useful Post:

    Derek (08-03-2009)

  14. #11
    AlboHacker's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    in front of pc
    Posts
    27
    Reputation
    10
    Thanks
    10
    My Mood
    Doh
    Lol thank you nice tut it helps a lot noobs like me in the making of hacks lol but i have a problem when i try to compile it a message pops out saying: The system cannot find the file specified. And it would not let me save it or open it. Please someone help! What should i do?
    [img]https://************.com/sig/020/intellz.jpg[/img]

    [IMG]https://i651.photobucke*****m/albums/uu232/CoolAlbo/AlbanianWarrior-ok.gif[/IMG]

    made by photoshop if u need me to do something like that message me


    PLEASE THANK ME IF THIS HELPED!!!


    Goals:
    complete 10 posts[]
    complete 50 posts[]
    complete 100posts[]
    Make my very own hack[X]
    Share hack with only 10 ppl[X]
    Get my hack patched because of noobs[X]
    Pwn noobs with hacks[X]
    Pwn noobs without hacks[X]
    Become a mod[]
    Create free injectors all the time[X]
    Get my account flagged[X]
    Mess with other ppls computer by hacking them[X]lol
    Get kicked out of rooms without hacks[X]
    Dont get kicked out of rooms with hacks [X] weird

  15. #12
    crushed's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    My name is Jay. k?
    Posts
    415
    Reputation
    10
    Thanks
    113
    My Mood
    Sneaky
    Way to revive a thread. Why, where the hell are you? While your on vacation, we're going through hell.

  16. #13
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Every time you bump an old thread...a small child gets raped by why06.

    Please, save the children.

  17. The Following User Says Thank You to Lolland For This Useful Post:

    Hell_Demon (12-28-2009)

  18. #14
    crushed's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    My name is Jay. k?
    Posts
    415
    Reputation
    10
    Thanks
    113
    My Mood
    Sneaky
    Quote Originally Posted by AlboHacker View Post
    Lol thank you nice tut it helps a lot noobs like me in the making of hacks lol but i have a problem when i try to compile it a message pops out saying: The system cannot find the file specified. And it would not let me save it or open it. Please someone help! What should i do?
    Btw, to fix your problem, it seems your missing a file, or your misspelled a file name. Just either re-install your IDE, or check your program for mistakes.

Similar Threads

  1. [tut for noobs]How to make a boneshot hack with vb
    By atheist in forum WarRock - International Hacks
    Replies: 18
    Last Post: 02-19-2008, 07:20 AM
  2. [tut for noobs] How to make a fast as hack with vb
    By atheist in forum WarRock - International Hacks
    Replies: 19
    Last Post: 02-19-2008, 04:15 AM
  3. [tut for noobs] How to make a invi hack with vb
    By atheist in forum WarRock - International Hacks
    Replies: 14
    Last Post: 02-15-2008, 03:36 AM
  4. [tut for noobs] How to make a anti kick hack with vb
    By atheist in forum WarRock - International Hacks
    Replies: 3
    Last Post: 02-13-2008, 09:17 AM
  5. [tut] new tut for starting hackers... again, making advanced hacks i guess
    By blackdrag0 in forum WarRock - International Hacks
    Replies: 21
    Last Post: 06-27-2007, 06:28 PM

Tags for this Thread