S
steve005
Hi, I am writing a binary file with matlab that consists of a couple
hundred double values and then reading it in with c++. The problem
arises in c++ when I try and read in the files. At a specific point it
stops and wont read any more values. I use this code to open it and
read it:
if( (err = fopen_s( &fp,"C:/simfile1.tmg0" , "rb" )) != 0 );
fread(&coneAngle,sizeof(double),1,fp);
After about twenty simmilar reads it fails, returns an error and quits
reading data. I've
When I change the data it works just fine, I am opening up the file in
binary mode but I think it is hitting an EOF character or something
like that...
I work on a win32 machine, I've compiled it on a mac and it reads all
the data just fine. Is there any way to read the data on a windows
machine and get past this hiccup? I've also tried reading the same
file with ifstream in binary mode with the same results. Any ideas?
hundred double values and then reading it in with c++. The problem
arises in c++ when I try and read in the files. At a specific point it
stops and wont read any more values. I use this code to open it and
read it:
if( (err = fopen_s( &fp,"C:/simfile1.tmg0" , "rb" )) != 0 );
fread(&coneAngle,sizeof(double),1,fp);
After about twenty simmilar reads it fails, returns an error and quits
reading data. I've
When I change the data it works just fine, I am opening up the file in
binary mode but I think it is hitting an EOF character or something
like that...
I work on a win32 machine, I've compiled it on a mac and it reads all
the data just fine. Is there any way to read the data on a windows
machine and get past this hiccup? I've also tried reading the same
file with ifstream in binary mode with the same results. Any ideas?