Forum: C 29 Days Ago |
| Replies: 1 Views: 179 The simplest hint that actually narrows the range is to tell the user "too high" or "too low" for wrong guesses. |
Forum: C Sep 8th, 2004 |
| Replies: 5 Views: 3,514 Correct; hardware interrupt 9h is the keyboard interrupt, and it's possible to use that to get keyboard states. But if you're compiling for Win32, then by all means use the API like bdiamond... |
Forum: C Jun 18th, 2004 |
| Replies: 5 Views: 2,547 There certainly is... Using the library functions as much as possible is good (code reuse, more sleep)--but it can be quite educational to write your own as well. It builds character, puts hair on... |
Forum: C Jun 17th, 2004 |
| Replies: 5 Views: 2,547 The sprintf function (http://www.cplusplus.com/ref/cstdio/sprintf.html) should work for that:
#include <stdio.h>
void Set(char string_time[])
{
sprintf(meridian, string_time);
}
If you... |
Forum: C Jun 10th, 2004 |
| Replies: 6 Views: 3,164 The for loop without any body will execute (n - 2) times, but the first line in your loop above is j = n; which, as written, alters the value of j and thus jacks around with the loop's normal... |
Forum: C Jun 7th, 2004 |
| Replies: 6 Views: 3,164 As long as the condition is true the first time it is tested, you're right--the loop behavior is the same. But a for loop always tests the condition before entering the loop body; the above loop... |
Forum: C Jun 3rd, 2004 |
| Replies: 6 Views: 3,164 Is that code complete/correct? The two questions don't make much sense. Both ask how many times the while loop iterates, but what is k supposed to be? And look at the for loop closely--how many... |