Re: Programs with if statements not working

From: Chris \( Val \) (chrisval_at_bigpond.com.au)
Date: 01/06/04


Date: Tue, 6 Jan 2004 23:47:50 +1100


"Ken" <pianoqst@aol.com> wrote in message
news:5e197cfa.0401060336.7aff15bc@posting.google.com...

[snip]

| Thanks, Chris and Russell for your replies. Chris, your advice worked
| very nicely, although the compiler issued a warning.
|
| I am very new to programming in C++ and I interpreted your advice
| "include the header <climits> to use 'INT_MAX' " and did the
| following:
|
| #include <iostream> <climits>
|
| and got this warning - [Warning] extra tokens at end of #include
| directive.
|
| I don't know what that means. Did I do it incorrectly?

No, not quite :-).

Put then on an separate line as follows:

#include <iostream>
#include <climits>

| Another question on something in your reply;
|
| "PS: You can always run your program executable directly from
| the command line, where you will see the expected output."
|
| I don't know what that means, would you explain further.
| I am using Dev-C++ 4.9.8.0 on a Pentium IV running Windows XP.

What I meant by that was, when you compile and build your
program, an executable is produced.

Once you have the executable, open up an command prompt
window from your start menu, and type in the following,
substituting the relevant details:

Drive:\YourPathToTheExecutable\ExecutableName.exe

That should run your program executable for you to
view it's output.

Cheers.
Chris Val