Hello, i am new here, and i come only in my dire need. i have a program that is supposed to read a binary file that contains a 2D array and its size. however i also have a function prototype that takes a 2D array as an argument. my problem is that the function prototype NEEDS the number of columns in order to compile and i cant seem to figure out how to get that value out of the main function and into the prototype
void *sortArray(float array[][], int rows, int cols, int column);
int main() {
string ifilename,ofilename;
float *array = nullptr;
int rows,cols, column;
ifstream binFile;
cout << "Before using This program, Please make sure that the file you want to open is in this folder!!" << endl;
cout << "Please enter the name of a binary file to be opened: ";
getline(cin,ifilename);
binFile.open (ifilename, ios::in | ios::binary);
if(binFile.is_open()){
cout << " was successfully opened and read!" << endl;
}
elseif(!binFile.is_open()){
cout << " could not be opened or was not found!" << endl;
return 1;
}
binFile >> rows; // here the rows and cols are defined from the .bin file
binFile >> cols;
}
this isnt my entire program. should i post it all?
the binary is as follows: