Question: I need to limit an array to 100 values and if a user goes over that limit, it would prompt them they had exceeded the
I need to limit an array to 100 values and if a user goes over that limit, it would prompt them they had exceeded the limit. The code complies but it just sorts the array as-is so it doesnt notice there was more then 100 floating point values.
int ARRAY_SIZE = 100; //array size is 100 max float numbers [ARRAY_SIZE], value; char ch; int count = 0; ifstream inputFile; //input file steam object inputFile.open("floatnumbers.txt"); while ( count < ARRAY_SIZE && inputFile >> numbers [count]) count++; { if ( ARRAY_SIZE > 100) { cout << "You have Exceeded array limit" <
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
