Home > Back-end >  For help, C how to read the raw file data, and get the data space position information
For help, C how to read the raw file data, and get the data space position information

Time:11-22

I want to read a raw files containing three-dimensional data
From the Internet to find such an algorithm
 
Void InitArrayFromVolFile (float * & amp; Data, const char * fileName, int length)
{
Long dataSize=length;
STD: : FILE * FILE=fopen (fileName, "rb");
If (the file==NULL)
{
Printf (" open "the file failed \ n");
}
//fread (data, sizeof (unsigned char), dataSize, file).
Fread (data, sizeof (float), dataSize, file).
The fclose (file);
}

But this algorithm to the data into a one-dimensional array, don't know the exact location of the space
A great god, please grant instruction!!!!!!

CodePudding user response:

This has nothing to do with what language code, the code does not read the file data stream into memory, the key to read the data according to what you said the raw file format of parsing
  • Related