Page 1 of 4 123 ... LastLast
Results 1 to 15 of 47
  1. #1
    DBag4Life69's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    290
    Reputation
    13
    Thanks
    59
    My Mood
    Twisted

    Lightbulb [Proof]I am learning C++

    Hey guys, when I first started wanting to make hacks, I was told to learn C++.
    Some of you don't believe it until you see it, and even though you see what my sig says, alot of people lie.
    So, using the LOW amount of knowledge I have of C++ so far, I wrote a simple program that calculates my percentages that I update my sig with. That and another reason I made it, is to make it easier on me.
    So I have to do less steps to calculate it.

    All I have to do on it is type in the amount of pages I have read so far, and it automatically calculates the percentages for me.

    Of course, I plan to make it alot more complex and everything, the more I learn but this took me 3 mins to write up. I thought of it about 20 mins ago while I was smoking a cigg.

    Don't flame me, I am learning.

    [PHP]
    // Credits: D-Vid aka Illusionz
    #include <iostream>

    int main()
    {
    using namespace std;
    float CppPrimer;
    float total;
    int pages;

    cout << "Enter the total amount of pages that you've read so far: \n\n";
    cin >> pages;
    cout << endl;
    CppPrimer = 1225;
    total = 2501;
    cout << "Percentage outta the C++ Primer Plus: 5th Edition: " << pages / CppPrimer * 100 << "%" << endl;
    cout << "Percentage TOTAL outta all the books: " << pages / total * 100 << "%" << endl;
    }
    [/PHP]

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

    [MPGH]AVGN (09-26-2010),Stephen (09-25-2010)

  3. #2
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,067
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    Very nice, but you have a long way to go before you start making menus and hacks, and especially inventing new ones.

    Good luck to you
    Dont ban me

  4. The Following User Says Thank You to markoj For This Useful Post:

    DBag4Life69 (09-25-2010)

  5. #3
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,030
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Someone reading a book...Its the apocalypse!!!!!


    Jk. Good Job to you.
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  6. The Following User Says Thank You to whatup777 For This Useful Post:

    DBag4Life69 (09-25-2010)

  7. #4
    DBag4Life69's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    290
    Reputation
    13
    Thanks
    59
    My Mood
    Twisted
    Quote Originally Posted by whatup777 View Post
    Someone reading a book...Its the apocalypse!!!!!


    Jk. Good Job to you.
    Lolz. I know what you mean.
    Most people aren't very determined.

    I am.

    I am determined to learn C++ as a language, so I can make stuff that I can use for ANYTHING.
    Not just for hacks.

    Now, I know that's what my inspiration WAS to start this determination, but my inspiration changed now.

    But ANYWAYS, I figured I would release that code, since it's proof that I AM in fact learning SOMETHING, cuz I wrote that all on my own.

  8. #5
    NOOBJr's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    in NOOB
    Posts
    1,426
    Reputation
    112
    Thanks
    693
    Nice job i guess. i didnt read a c++ book. But im going to start soon.

  9. #6
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    Write me an RPG bich

  10. The Following User Says Thank You to Crash For This Useful Post:

    IcySeal (09-26-2010)

  11. #7
    DBag4Life69's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    290
    Reputation
    13
    Thanks
    59
    My Mood
    Twisted
    Quote Originally Posted by Crash View Post
    Write me an RPG bich
    RPG??
    Could you please explain yourself a little more, and a little bit more sophisticated? lolz.

  12. #8
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    Quote Originally Posted by DBag4Life69 View Post


    RPG??
    Could you please explain yourself a little more, and a little bit more sophisticated? lolz.
    Text RPG. I don't care if it's only text or an RPG where the scenery is made of text.

  13. #9
    tahha's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    my keyboard or my bed
    Posts
    122
    Reputation
    9
    Thanks
    3
    dont use int main(){} unless you use return(0); at the end like so

    Code:
    int main(){
    //code
    return(0);
    }
    instead use this style
    Code:
    void main(){
    //code
    }
    it will drop out some errors you get later in longer programs

    but with the int main your usen main as a function not a procedure
    so with out the return you can get a unexpected end of program error
    with the void your making a procedure not a function

    the big difference is functions return a value
    procedures dont, they do something and most of the time call functions
    Last edited by tahha; 09-25-2010 at 03:36 PM.
    (BTW: My Name Is PowerHouse On Other Forums)

    Click this to get PowerHouse Private!

  14. #10
    DBag4Life69's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    290
    Reputation
    13
    Thanks
    59
    My Mood
    Twisted
    Quote Originally Posted by Crash View Post
    Text RPG. I don't care if it's only text or an RPG where the scenery is made of text.
    Soo... Yer saying you basically want me to write a program that prints out IN text, a picture of an RPG(as in a rocket launcher)?

    OR

    You want me to write a program that is like a console based, text based RolePlayingGame?

  15. #11
    mmbob's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    ja
    Posts
    655
    Reputation
    70
    Thanks
    1,156
    My Mood
    Bitchy
    Quote Originally Posted by tahha View Post
    dont use int main(){} unless you use return(0); at the end like so

    Code:
    int main(){
    //code
    return(0);
    }
    instead use this style
    Code:
    void main(){
    //code
    }
    Definitely not, you NEVER use void main();

  16. #12
    cow111's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    connecticut
    Posts
    113
    Reputation
    8
    Thanks
    6
    My Mood
    Bashful
    dang ive been loookking everyyyy wwweeerrreee on how to put the codes in and were and stuff i cant find out lolol


    THUMBS ME UP

    i made my own F******G sicle



  17. #13
    flashlight95's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    12-34 Poopie Street Posts: Over 9000!
    Posts
    128
    Reputation
    10
    Thanks
    15
    You need to pause it at the end so you can read what it says.
    /

  18. #14
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    Quote Originally Posted by DBag4Life69 View Post


    Soo... Yer saying you basically want me to write a program that prints out IN text, a picture of an RPG(as in a rocket launcher)?

    OR

    You want me to write a program that is like a console based, text based RolePlayingGame?
    Example of choice 1 :

    Code:
    Blah has attacked !
    Blah has done 5 damage !
    ....
    ...

    OR :

    Code:
    @@@@@@@@@@@@@@@@@@@@@@@
    @_____________________@
    @_____________________@
    @_________O___________@
    @_____________________@
    @_____________________@
    @@@@@@@@@@@@@@@@@@@@@@@
    
    Arrow keys to move...

  19. #15
    DBag4Life69's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    290
    Reputation
    13
    Thanks
    59
    My Mood
    Twisted
    Quote Originally Posted by tahha View Post
    dont use int main(){} unless you use return(0); at the end like so

    Code:
    int main(){
    //code
    return(0);
    }
    instead use this style
    Code:
    void main(){
    //code
    }
    it will drop out some errors you get later in longer programs

    but with the int main your usen main as a function not a procedure
    so with out the return you can get a unexpected end of program error
    with the void your making a procedure not a function

    the big difference is functions return a value
    procedures dont, they do something and most of the time call functions

    so for this you could do

    Code:
    // Credits: D-Vid aka Illusionz
    #include <iostream>
    const int CppPrimer = 1225;
    const int total = 2501;
    
    int calcuCPPP(p){
        return(p / CppPrimer * 100);
    }
    int calcutotal(p){
        return(pages / total * 100);
    }
    
    void main(){
        using namespace std;
        int pages;
    
        cout << "Enter the total amount of pages that you've read so far: \n\n";
        cin >> pages;
        cout << endl;
    
        cout << "Percentage outta the C++ Primer Plus: 5th Edition: " << calcuCPPP(pages) << "%" << endl;
        cout << "Percentage TOTAL outta all the books: " << calcutotal(pages) << "%" << endl;
    }
    There's a big problem there with how you re-wrote that. :-|
    p hasn't been defined, and pages is also not defined. I know HOW to do that, but no matter what, your code there WILL not work, unless you change a couple of things. ;-)

Page 1 of 4 123 ... LastLast

Similar Threads

  1. Hey i want to learn to make with c++ code a pb proof wh please help
    By xaris in forum Call of Duty Modern Warfare Help
    Replies: 8
    Last Post: 05-05-2010, 11:57 AM
  2. CS 1.6 VAC2 proof hacks AND cheat death hacks
    By Brunogol in forum General Game Hacking
    Replies: 28
    Last Post: 12-18-2006, 09:26 PM
  3. Where could I learn C++? (Beginner, and Advanced stuff)
    By TsumikiriX in forum C++/C Programming
    Replies: 8
    Last Post: 07-19-2006, 09:11 PM
  4. Learn Hacking
    By Loler in forum Hack Requests
    Replies: 2
    Last Post: 01-22-2006, 04:20 PM
  5. Looking to learn.
    By SadisticGrin in forum Hack Requests
    Replies: 1
    Last Post: 01-15-2006, 07:57 PM