Passing a 2D array to a function prototype

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 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;
    }
    else if(!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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
4
4
54
56
72
19
34
20
21
24
69
70
24
27
31
38
3
16
Last edited on
could you please show us the binary file?
closed account (48T7M4Gy)
Yeah post all of it - well at least the relevant but runnable part.
Topic archived. No new replies allowed.