- Mar 31, 2003
- 11,679
- 0
- 81
Hey Guys,
I am trying to read a binary file (I believe it is a flat binary structure). The file is a bunch of velocity and position vectors that I can't get into; however, the file is ~515MB.
The array needs to be partially dynamically allocated if that makes any sense.
The array for my particular data set is [17, SIZE].
Since I am working with position vectors and what not, the values that need to be read in are doubles; however, it seems that ifstream.read() only supports reading in char*.
Can anyone help with this?
I know that in the C99 standard you do not need to call new to allocate that memory so in my header I have:
double* memBlock;
and in the file I have:
memBlock[17, chunkSize];
After that anything I try to use to read in the data crashes at run time? Any suggestions?
Thanks,
-Kevin
I am trying to read a binary file (I believe it is a flat binary structure). The file is a bunch of velocity and position vectors that I can't get into; however, the file is ~515MB.
The array needs to be partially dynamically allocated if that makes any sense.
The array for my particular data set is [17, SIZE].
Since I am working with position vectors and what not, the values that need to be read in are doubles; however, it seems that ifstream.read() only supports reading in char*.
Can anyone help with this?
I know that in the C99 standard you do not need to call new to allocate that memory so in my header I have:
double* memBlock;
and in the file I have:
memBlock[17, chunkSize];
After that anything I try to use to read in the data crashes at run time? Any suggestions?
Thanks,
-Kevin