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 


[C++] Need new method..
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Fri Jul 11, 2008 12:21 pm    Post subject: Reply with quote

manc wrote:
Oh ok, what about assigning NULL to iNumber and iGuess?

And then Its an endless loop because of (;;) ?


NULL = nothing. Instead of assigning it something else.

And it is and endless loop, but I perfer to use

Code:
While (1==1){}
Back to top
View user's profile Send private message Send e-mail
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Fri Jul 11, 2008 12:51 pm    Post subject: Reply with quote

Depending on your code, if you do not define variables with a value, you will run into errors. NULL is just the standard value to give anything you are creating at first, which means nothing, empty, etc.

And yes, for (;Wink means an endless loop unless you do something inside of the loop itself to exit it.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
manc
Grandmaster Cheater
Reputation: 1

Joined: 16 Jun 2006
Posts: 551

PostPosted: Fri Jul 11, 2008 1:22 pm    Post subject: Reply with quote

Alrighty, thanks Wiccaan I got it!
_________________
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Jul 11, 2008 1:41 pm    Post subject: Reply with quote

NULL is just a #define for 0.

kitterz wrote:
And it is and endless loop, but I perfer to use

Code:
While (1==1){}


Bad coding practice, it adds an extra cmp instruction into the loop when it isn't needed.

Jani wrote:
Flyte wrote:
Anyways, here is what you are looking for in proper C++, with error checking.
Fails:
Code:
Guess the number between 1-100. Begin...
Guess 1: Invalid input.
CTRL-C fails :<


Cheater. :<

Jani wrote:
And I'd prefer
Code:
::srand( ::time(NULL) );


As I previously told Nos3001, windows.h is a far more common header, so it is generally in your best interest to include that instead of ctime. It's all just personal preference though.
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Fri Jul 11, 2008 2:06 pm    Post subject: Reply with quote

Flyte wrote:
NULL is just a #define for 0.

kitterz wrote:
And it is and endless loop, but I perfer to use

Code:
While (1==1){}


Bad coding practice, it adds an extra cmp instruction into the loop when it isn't needed.


Really? So what would be the best infinite loop to use?
Back to top
View user's profile Send private message Send e-mail
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Jul 11, 2008 2:23 pm    Post subject: Reply with quote

kitterz wrote:
Really? So what would be the best infinite loop to use?


Code:
for(;;) {
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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