In C, the first parameter would need to be the address of the buffer to put the data into, cast to (void *). The second parameter would be the size of each element in bytes, which for uint32 would be 4 (that is, 4 bytes.) The third parameter would be the count of the number of items to read, which would be 1 for your example.
The 4th parameter needs to be the stream pointer that resulted from an fopen() (or one of some more obscure library calls). Stream pointers in C and C++ are not integers. The integers that you see in MATLAB are much closer to C's "file descriptors", and if you mix up the two then you will get an compiling error or you will get a crash.
"As of R2020a, character-oriented file I/O functions such as fscanf, fgets, and fgetl trigger automatic character set detection when reading a file that was opened using fopen without a specified encoding."
My suspicion then is that the "automatic character set detection" may require looking through the full file.
Best Answer