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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started