Hey,
first of all sorry for my bad english, but I'm from Germany ;)
I found something special in the getline() function, I don't understand.
If I use the getline function in case of an Excel-sheet or an image - to get the image-data - the getline function breakes after a NULL termination ( \0 )
fstream oFile_e;
oFile_e.open("B AB.xls",ios::in );
oFile_e.getline (chTest, 100,'\n');
BAB.xls containes the \0 from position 9 to 12
chTest is after the getline function only filled up to position 9 ( after the first \0 )
--> no problem with the ios::binary mode. With this mode it's possible to read the whole data.
But if I write out some chars in a file and some of them are \0, I can read the whole data WITHOUT the ios::binary mode.
Do you understand that phenomenon?
first of all sorry for my bad english, but I'm from Germany ;)
I found something special in the getline() function, I don't understand.
If I use the getline function in case of an Excel-sheet or an image - to get the image-data - the getline function breakes after a NULL termination ( \0 )
fstream oFile_e;
oFile_e.open("B AB.xls",ios::in );
oFile_e.getline (chTest, 100,'\n');
BAB.xls containes the \0 from position 9 to 12
chTest is after the getline function only filled up to position 9 ( after the first \0 )
--> no problem with the ios::binary mode. With this mode it's possible to read the whole data.
But if I write out some chars in a file and some of them are \0, I can read the whole data WITHOUT the ios::binary mode.
Do you understand that phenomenon?
Comment