In corporating a Sentinel
Jul 25, 2016 at 5:41am
***
Last edited on Jul 29, 2016 at 7:58pm
Jul 26, 2016 at 3:21am
I want to incorporate a sentinel which will
stop the array from storing any further numbers if it receives more than 50 numbers |
1 2 3
|
for (numbers = 0; numbers < 50; numbers++)
dataIn >> array[numbers];
dataIn.close();
| |
tick
or a negative number or zero. |
Maybe have a cin >> some_variable and then an if control? :)
Topic archived. No new replies allowed.