EDIT: added the requirements/outlines of my code in another comment. If anymore information is required feel free to ask.
This is currently the code I'm working with. I've got it to accomplish everything required of me so far, however, when I use option 1 more than once without exiting the program it doesn't seem to store the correct values or amount of values in the array. I've tried using the delete[] command in several places (at the beginning of case 1 in the switch, at the start of function option1, and just before the first fin.open) to no success. I'm not quite sure what the issue with my code is and why it isn't working.
For example, if I read in a file test.txt that only has 7 inside of it I will receive the proper responses. However, if I read that same test.txt file twice in a row I get much larger numbers where I should always just be receiving 7 back.
If I continue to do this over and over again the numbers get exponentially larger.
I'd fiddle with it all night, but its 3 am and I work at 7. Hate to quit on my work, but I just don't have the time.
Here are the required elements of my array:
Proper indenting.
Please use only one array. No duplicate arrays are necessary.
Options 2 and 3 MUST check for an empty array as described in the previous paragraph.
Option 1 MUST prompt the user for a filename. You CANNOT hardcode a filename into your program.
Option 1 MUST print out an error message and continue to the next menu iteration if the input file cannot be opened.
If file open fails, do NOT exit the program.
Close the input file after you finish extracting all of the integers.
If the size of the array (number of elements in the array) is 1 when Option 3 is selected, print an error message instead of calculating the deviation (there must be at least 2 elements in order to calculate the deviation). Still calculate and display the average.
"The user might select the menu options in any sequence, and more than once, and the program must still operate perfectly.
When an assignment says to input integers, the array declared must be an integer array."
^^
This is the reason I didn't declare my array as a double which I believe might have made my code a bit more efficient.