Hi. I am having difficulty with seeing or interpreting the errors in this program. Any help with showing how/what needs to be fixed would be appreciated!
Try compiling it. Your compiler should give you error messages to help you debug.
But here are a few major issues:
1. You need to declare functions and variables before you can use them.
2. ifstream needs the header #include <fstream>
3. Your function readData is a void function yet it returns a value.
1. #include <fstream>
2. Remove line 54. Can't return a value in a function declared to return void.
3. Forward declare void print(int list[], int size) like you did with your other functions.
You can have function declaration, or prototype and declaration. Prototype is a declaration of function before implementing it(writing function code).
It looks like this:
1 2 3 4 5 6 7
void holdscrn();//Now we know that function holdscrn() exists and what it looks like.
//some code...
void holdscrn()
{
//code for function
}
Function prototypes are broadly used because it's just easier to have code in one place(usually at the end of file or in other file), and declarations at the beginning. It kind of looks like table of contents in book ;)