R
root
Hi group,
Apologies in advance if this has been asked somewhere before, but I haven't
managed to get anything from the Google archives - I've been getting
introductory guides to C++ all day long.
I am writing a program in Visual C++ 6 SP5.
My code has a lot of "if" statements - 19 to be exact.
If the if statements are true (technically, there should only be one that is
ever true), the program needs to continue on after the if statements.
Each if statement assigns a particular string value to a character/string
array if the if statement is true.
Unfortunately, I have the problem whereby only my 19th if statement is ever
true. The rest never become true no matter what changes I make to my
variables.
I know using one big "switch" would be appropriate here, but is it possible
to use switch with a float as its condition? My Visual C++ compiler didn't
like it when I used that.
Apologies for so many questions... any help would be appreciated.
Thanks!
Apologies in advance if this has been asked somewhere before, but I haven't
managed to get anything from the Google archives - I've been getting
introductory guides to C++ all day long.
I am writing a program in Visual C++ 6 SP5.
My code has a lot of "if" statements - 19 to be exact.
If the if statements are true (technically, there should only be one that is
ever true), the program needs to continue on after the if statements.
Each if statement assigns a particular string value to a character/string
array if the if statement is true.
Unfortunately, I have the problem whereby only my 19th if statement is ever
true. The rest never become true no matter what changes I make to my
variables.
I know using one big "switch" would be appropriate here, but is it possible
to use switch with a float as its condition? My Visual C++ compiler didn't
like it when I used that.
Apologies for so many questions... any help would be appreciated.
Thanks!