Help with code :S menu

User Tag List

Results 1 to 8 of 8
  1. #1
    Komaqtion's Avatar Member
    Reputation
    1
    Join Date
    Sep 2007
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with code :S

    Hi!!
    I'm just getting started with C++, and i'm using Dev ++ as a compiler.
    And now i got a few problems:S For the first, this code won't compile, any1 knows why ??? And also, why does this program just shutdown after the if?? i know this because it worked a bit before it was unable to compile XD

    Ok, here's the code
    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    int main(){;
    unsigned char i (0);
    string s;
      cout<<"What is your age?\n";
      cin>>i;
      cin.get;
      cout << "Is this what your age is?\n" << i << "\n";
      cin>>s;
      cin.get();
      if (s=="Yes"){;
         i=i*2+3;
         cout << "Well now you've aged in a second!\n" << "Your age is now: " << i << "\n";
         if (i==13){;
         cout << "You're 13! This means bad luck for you!";
         };
      else if (s=="No"){;
         cout << "Then this program isn't working XD!\n";
      };
      cin.get();
    
    };

    Help with code :S
  2. #2
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    int main()
    {
        cout << "What is your age?" << endl;
        unsigned int i = 0;
        cin >> i;
        cin.ignore(); // http://www.augustcouncil.com/~tgibson/tutorial/iotips.html
        cout << "Is this what your age is?" << endl << i << endl;
        string s = "";
        cin >> s;
        cin.ignore();
        if (s=="Yes")
        {
            i=i*2+3;
            cout << "Well now you've aged in a second!" << endl << "Your age is now: " << i << endl;
            if (i==13)
            {
                cout << "You're 13! This means bad luck for you!" << endl;
            }
        }
        else if (s=="No")
        {
            cout << "Then this program isn't working XD!" << endl;
        }
        cin.get();
        return 0;
    }

  3. #3
    markpaul41's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i know it
    contact me at [email protected]

  4. #4
    Komaqtion's Avatar Member
    Reputation
    1
    Join Date
    Sep 2007
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, sorry but still not working :S
    This is the error the the compilator:
    Compilator: Default compiler
    Building Makefile: "C:\Dev-Cpp\Makefile.win"
    Run make...
    make.exe -f "C:\Dev-Cpp\Makefile.win" all
    g++.exe -D_DEBUG__ -o "First Program.exe" -L C:\Dev-Cpp\lib" 'g3
    g++.exe: no input files
    make.exe: *** [''First] Error 1
    Run Finished

    I'm swedish, so just quickly translated this for you

  5. #5
    Komaqtion's Avatar Member
    Reputation
    1
    Join Date
    Sep 2007
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any1 knows what's happening ???

  6. #6
    Komaqtion's Avatar Member
    Reputation
    1
    Join Date
    Sep 2007
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    C'mon people ! I know you know this Or just tell me if there isn't something wrong :S

  7. #7
    apollo0510's Avatar Active Member
    Reputation
    18
    Join Date
    Aug 2008
    Posts
    53
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit: Deleted everything I wrote before, because those colons have no impact at all.

    What about the compiler error messages ?
    Last edited by apollo0510; 05-07-2009 at 08:37 AM.

  8. #8
    Komaqtion's Avatar Member
    Reputation
    1
    Join Date
    Sep 2007
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, that didn't help too much, i removed those ";" but it still won't compile XD

Similar Threads

  1. [PQR] Need help with Code
    By spawnpl in forum WoW Bots Questions & Requests
    Replies: 2
    Last Post: 04-23-2013, 12:32 AM
  2. Help with code please?
    By Zyraxian in forum WoW Bot Maps And Profiles
    Replies: 1
    Last Post: 10-09-2012, 12:32 PM
  3. Need a help with code [C#]
    By purri in forum WoW Memory Editing
    Replies: 14
    Last Post: 05-10-2010, 02:07 AM
  4. Help with code to find boober and splash
    By Dalord Urgod in forum WoW Memory Editing
    Replies: 2
    Last Post: 03-13-2009, 09:18 PM
  5. [Service][.NET aka VB8] Helping with code.
    By Clain in forum Programming
    Replies: 2
    Last Post: 06-09-2008, 09:36 AM
All times are GMT -5. The time now is 03:44 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search