In corporating a Sentinel

***
Last edited on
closed account (48T7M4Gy)
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.