Are you sure it's binary (not readable in a text editor)?
Are the numbers integers or floating point?
What size?
How many?
Is there initial data about the matrix size?
What is the output of this program (prints first 96 bytes in hex):
A C-style array type contains its dimensional information which sizeof can interpret (in bytes/chars).
Once passed to a function it "decays" to a pointer and the dimensional information is lost, so sizeof just yields the size of the pointer in that case.
#include <iostream>
using std::cout;
void f(int a[100]) { // The '100' here is meaningless.
cout << "f: " << sizeof a << '\n'; // just prints ptr size
// There's no way to know that the array has a size of 100
// unless you pass the size in or define a global size.
}
// You can retain dimensional information with a reference.
// But then it can't be called with a different size array.
void g(int (&a)[100]) {
cout << "g: " << sizeof a << '\n'; // prints 400 (for 32-bit int)
}
void h(int a[10][10]) { // The first '10' is meaningless.
cout << "h: " << sizeof a << ' ' // just pointer size
<< sizeof a[0] / sizeof a[0][0] << '\n'; // prints 10
// Note that only the first dimension of array info is lost.
}
int main() {
int a[100];
cout << "a: " << sizeof a << ' ' << sizeof a / sizeof a[0] << '\n';
f(a);
g(a);
int a2[90];
f(a2); // okay
//g(a2); // won't compile
int b[10][10];
int TotalBytes = sizeof b;
int TotalElements = TotalBytes / sizeof b[0][0];
int Rows = TotalBytes / sizeof b[0];
int Cols = TotalElements / Rows;
cout << "Total bytes: " << TotalBytes << '\n';
cout << "Total elements: " << TotalElements << '\n';
cout << "Rows: " << Rows << " Cols: " << Cols << '\n';
h(b);
}