I'm reading a file a RSA encrypted binary file which contains nulls. The file is encrypted and saved in python, then read in c++.
Python treats it fine, reading and writing it just displays the nulls as
...\x94\x00\xbf...
However, in my C++ it terminates it early.
FILE* fpy = fopen("test.txt", "rb");
unsigned char* signPy = (unsigned char*)malloc(256);
fread(signPy, 1, 256, fpy);
fclose(fpy);
cout << signPy << endl;
The file is exactly 256 bytes so I know I'm allocating enough memory. Using fread it terminates at the first null. Any help would be appreciated.