- #1
John O' Meara
- 330
- 0
I have a long C++ program that has a few simple statements in it. At the beginning I have ;
#define NUM_DP 10
Further on in the program I have this conditional statement;
short int ct, j;
.
.
.
ct = op2.test(op2.num);
if (ct < (NUM_DP - 1))
for (j = 1; j < 20; j++){
code block
}
The test function returns a value of ct = 9, why then does the for loop execute . Can't you use constants inside conditional statements? Please help. Thanks.
#define NUM_DP 10
Further on in the program I have this conditional statement;
short int ct, j;
.
.
.
ct = op2.test(op2.num);
if (ct < (NUM_DP - 1))
for (j = 1; j < 20; j++){
code block
}
The test function returns a value of ct = 9, why then does the for loop execute . Can't you use constants inside conditional statements? Please help. Thanks.