| View previous topic :: View next topic |
| Author |
Message |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Fri Jul 11, 2008 12:21 pm Post subject: |
|
|
| 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
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Fri Jul 11, 2008 1:22 pm Post subject: |
|
|
Alrighty, thanks Wiccaan I got it! _________________
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Fri Jul 11, 2008 1:41 pm Post subject: |
|
|
NULL is just a #define for 0.
| kitterz wrote: | And it is and endless loop, but I perfer to use
|
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 |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Fri Jul 11, 2008 2:06 pm Post subject: |
|
|
| Flyte wrote: | NULL is just a #define for 0.
| kitterz wrote: | And it is and endless loop, but I perfer to use
|
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 |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Fri Jul 11, 2008 2:23 pm Post subject: |
|
|
| kitterz wrote: | | Really? So what would be the best infinite loop to use? |
|
|
| Back to top |
|
 |
|