cant do that the data i am trying to read and write is in the middle of a big binary file
the file pointer is all ready set for the read and it read ok.
it the fwrite that give me the error in vs2017 before i even compile.
You can't change a
sizeof(char)? I doubt that.
fread(buff, sizeof(char) , c2, filestringdata);
fread(buff,1 ,c2, filestringdata);
Do the same for
Where are you getting the value for c2? Your problem could be elsewhere than
fwrite(). Impossible to tell without seeing more of your code.
It really doesn't make any difference if you use sizeof(char) or 1, since sizeof(char) is always 1.
But you really should be checking to insure that the fread() actually read C2 bytes before you try to write the information to the output file.
Also why are you using C FILE instead of C++ file streams?
fread works I trace it thru the debugger
I can even comment out fread
the error still in fwrite
I can put numbers in fwrite or even size of
the error still there
FILE *filedata = fopen(t5c, "wb");
unsigned char *buff = new unsigned char[c2];
fwrite(buff, 1, 1,filedata);
could it be in the include
#include <direct.h> //make directory
using namespace std;
Why is *buff now an unsigned char?
If you comment out the fread() buff will be uninitialized so you will be trying to write some unknown value to the file.
Why is fwrite giving me a error before i even compile
Last edited on
the data i am reading in is compress zip
You're not showing any information about the input file. So how are you uncompressing this zip?
|doesnt really matter why is fwrite giving me a error before i even compile|
So what exactly are the error messages, all of them? The picture you posted appears to be pointing to the strcat() call, but it is hard to read so I may be wrong.
By the way you are really not showing enough content. And not answering all the posed questions is not helping either.
Last edited on
another dumb mistake
for some reason the was a int fwrite=0; in my code