problem with fout.write: cannot write 0x0A (10 dec)
hello, i m trying to write the content of a pointer to a file:
unsigned char* ds=(unsigned char*)malloc(sizeof(unsigned char)*width*height);
fout.write(reinterpret_cast<const char*>(&(*ds)), width*height);
(i tried sizeof(*ds) instead of width*height but it does not work)
all it does is return a file slightly BIGGER than width*heigth, because of the following issue: the char 0x0A cannot be written, it is replaced by 0x0D0A (that s right, 2 chars for the price of 1)
can anyone help me on this, please? (no need to mention that i m new to MSVC++ .NET ...)
thanks a lot!