Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


need help setting up a variable in visual c++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
The Fish
Expert Cheater
Reputation: 3

Joined: 11 Aug 2008
Posts: 114
Location: Ohio bitch

PostPosted: Wed Feb 23, 2011 11:10 am    Post subject: need help setting up a variable in visual c++ Reply with quote

Code:
// Include the iostream library
#include <iostream>

//Use the standard namespace
using namespace std;

void ( )
{
   << cout << "Please pick a number between 1 and 10. Press any key to continue" << endl;
   system ("PAUSE");
   << cout << "Insert your number below." << endl;
   >> cin >> Number_1
   float Number_1 << endl;
   float Number_2 = NEED RANDOM NUMBER HERE << endl;
   float Result =Number 2
}

C'mon.
I need some help.

_________________
It was nice while it lasted.
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Wed Feb 23, 2011 11:19 am    Post subject: Reply with quote

random number from 1 to 10


Code:
rand() % 10 + 1;

it is in <stdlib.h>
Back to top
View user's profile Send private message MSN Messenger
The Fish
Expert Cheater
Reputation: 3

Joined: 11 Aug 2008
Posts: 114
Location: Ohio bitch

PostPosted: Wed Feb 23, 2011 11:25 am    Post subject: Reply with quote

Code:
// Include the iostream library
#include <iostream>

//Use the standard namespace
using namespace std;

void ( )
{
   << cout << "Please pick a number between 1 and 10. Press any key to continue" << endl;
   system ("PAUSE");
   << cout << "Insert your number below." << endl;
   >> cin >> Number_1
   float Number_1 << endl;
   float Number_2 = rand() % 10 + 1; << endl;
   float Result =Number 2
   system ("PAUSE");
}

that's what I have now.

but where do I add the "<stdlib.h>"?

_________________
It was nice while it lasted.
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Wed Feb 23, 2011 11:43 am    Post subject: Reply with quote

#include <stdlib.h>
Back to top
View user's profile Send private message MSN Messenger
The Fish
Expert Cheater
Reputation: 3

Joined: 11 Aug 2008
Posts: 114
Location: Ohio bitch

PostPosted: Wed Feb 23, 2011 11:55 am    Post subject: Reply with quote

Now i need to know why this won't build.
Code:
#include <iostream>

#include <stdlib.h>

//Use the standard namespace
using namespace std;

void ( )
{
   << cout << "Please pick a number between 1 and 10. Press any key to continue" << endl;
   system ("PAUSE");
   << cout << "Insert your number below." << endl;
   >> cin >> Number_1
   float Number_1 << endl;
   float Number_2 = rand() % 10 + 1; << endl;
   float Result =Number 2
   system ("PAUSE");
}

_________________
It was nice while it lasted.
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Wed Feb 23, 2011 12:02 pm    Post subject: Reply with quote

Code:
#include <iostream>

#include <stdlib.h>

//Use the standard namespace
using namespace std;

void ( )
{
float Number_1;
float Number_2 = rand() % 10 + 1;
float Result =Number 2;

   cout << "Please pick a number between 1 and 10. Press any key to continue" << endl;
   system ("PAUSE");
   cout << "Insert your number below." << endl;
   cin >> Number_1;

   system ("PAUSE");
}


no idea of what you are doing though.
Back to top
View user's profile Send private message MSN Messenger
The Fish
Expert Cheater
Reputation: 3

Joined: 11 Aug 2008
Posts: 114
Location: Ohio bitch

PostPosted: Wed Feb 23, 2011 12:07 pm    Post subject: Reply with quote

gogodr wrote:
Code:
#include <iostream>

#include <stdlib.h>

//Use the standard namespace
using namespace std;

void ( )
{
float Number_1;
float Number_2 = rand() % 10 + 1;
float Result =Number 2;

   cout << "Please pick a number between 1 and 10. Press any key to continue" << endl;
   system ("PAUSE");
   cout << "Insert your number below." << endl;
   cin >> Number_1;

   system ("PAUSE");
}


no idea of what you are doing though.

working on a number guesser.
You put a number in, and it give you a random number between 1 and 10.
It'll congratulate you if you're right once I'm done.

_________________
It was nice while it lasted.
Back to top
View user's profile Send private message
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Wed Feb 23, 2011 12:08 pm    Post subject: Reply with quote

From what I can gather the following causes the failure in building: "void" should be "void main", and "Number 2" should be "Number_2".
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Wed Feb 23, 2011 12:58 pm    Post subject: Reply with quote

Augustine wrote:
From what I can gather the following causes the failure in building: "void" should be "void main", and "Number 2" should be "Number_2".
this
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Feb 23, 2011 2:31 pm    Post subject: Reply with quote

void should be int main. here's a random function for you:

Code:
int rand() {
  return 4;
}
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Wed Feb 23, 2011 2:50 pm    Post subject: Reply with quote

Slugsnack wrote:
void should be int main. here's a random function for you:

Code:
int rand() {
  return 4;
}

lol
Back to top
View user's profile Send private message MSN Messenger
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Wed Feb 23, 2011 3:34 pm    Post subject: Reply with quote

Slugsnack wrote:
void should be int main. here's a random function for you:

Code:
int rand() {
  return 4;
}


Oh shit, lol'd.

PS. The comments in that code are so useful
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Feb 23, 2011 5:00 pm    Post subject: Reply with quote

http://xkcd.com/221/
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Wed Feb 23, 2011 6:56 pm    Post subject: Reply with quote

Slugsnack wrote:
http://xkcd.com/221/


that's why I found it amusing =]
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites