Liberation Gaming HQ
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Liberation Gaming is devoted to creating, editing, and improving the gaming experience.
 
HomePortalGalleryLatest imagesSearchRegisterLog in
Looking for site admins, to apply, post an application for site administration
The site continues to change, but the users discontinue to chat... keep posting people, come on!

 

 Newbie help?

Go down 
4 posters
AuthorMessage
legendman3
Follower
Follower



Posts : 23
Join date : 2010-06-06

Newbie help? Empty
PostSubject: Newbie help?   Newbie help? Icon_minitimeFri Jun 18, 2010 9:20 am

Well im new at C++ and im trying to make a program only stop if you enter the correct number.

I made so that you can type anything(or not type at all) and the program will quit.

I want it to only work if you enter the number 13.

Heres my code its really basic.

Code:
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
    int magic;
    cout << "You lost the game, now type the magic number:";
    cin >> magic;
   
    system("PAUSE");
    return 0;
}
Back to top Go down
WARLOCK
Superadmin
Superadmin
WARLOCK


Posts : 63
Join date : 2010-05-17
Age : 29
Location : Scotland (near Edinburgh)

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeFri Jun 18, 2010 2:32 pm

well it doesnt actually say 13 in the code and i think that would need to be their as a reference to the correct input
Back to top Go down
http://www.ukmandown.co.uk/
legendman3
Follower
Follower



Posts : 23
Join date : 2010-06-06

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeFri Jun 18, 2010 2:45 pm

Well can you give me a part of the code that i need to make it work?
I knew there was no 13 in the code.
Back to top Go down
WARLOCK
Superadmin
Superadmin
WARLOCK


Posts : 63
Join date : 2010-05-17
Age : 29
Location : Scotland (near Edinburgh)

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeFri Jun 18, 2010 2:46 pm

nope cause ive never written any C++ code in my life
Back to top Go down
http://www.ukmandown.co.uk/
legendman3
Follower
Follower



Posts : 23
Join date : 2010-06-06

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeFri Jun 18, 2010 4:04 pm

Then why is this section here?
Back to top Go down
WARLOCK
Superadmin
Superadmin
WARLOCK


Posts : 63
Join date : 2010-05-17
Age : 29
Location : Scotland (near Edinburgh)

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeFri Jun 18, 2010 4:11 pm

cause there are OTHER members and im sure someone knows C++
Back to top Go down
http://www.ukmandown.co.uk/
legendman3
Follower
Follower



Posts : 23
Join date : 2010-06-06

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeFri Jun 18, 2010 9:38 pm

Cool hope they help me...
Back to top Go down
The Liberator
Owner
The Liberator


Posts : 101
Join date : 2009-09-20
Age : 29
Location : Las Vegas, Nevada

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeSat Jun 19, 2010 9:56 am

Bleh, give me a bit, I'm going to re-write your code a bit, ill put in the () so you know what I changed and why.
() = Thoughts in coding and have no effect on the code itself.
Back to top Go down
http://Liberationgaming.com
legendman3
Follower
Follower



Posts : 23
Join date : 2010-06-06

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeSat Jun 19, 2010 12:30 pm

Or you can put in comments \\
Back to top Go down
GordonFreeman
Follower
Follower
GordonFreeman


Posts : 7
Join date : 2010-05-17
Age : 48
Location : Green Bay, WI

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeWed Jun 30, 2010 3:48 pm

I am pretty good with C++, you need a if-then-else loop.
Back to top Go down
https://www.youtube.com/user/godlikemachinima
legendman3
Follower
Follower



Posts : 23
Join date : 2010-06-06

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeWed Jun 30, 2010 6:19 pm

Thanks. But its kinda late for that.
Back to top Go down
GordonFreeman
Follower
Follower
GordonFreeman


Posts : 7
Join date : 2010-05-17
Age : 48
Location : Green Bay, WI

Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitimeThu Jul 01, 2010 6:21 pm

Well you know who to ask if you have questions in the future.
Back to top Go down
https://www.youtube.com/user/godlikemachinima
Sponsored content





Newbie help? Empty
PostSubject: Re: Newbie help?   Newbie help? Icon_minitime

Back to top Go down
 
Newbie help?
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Liberation Gaming HQ :: Development :: Coding (C++)-
Jump to: