I'm having a problem writing an unsigned char array to a file.
When I write it to stdout using printf, it displays properly, however if I write it to a file, when I open it, I can't read the file. It looks like it may be writing the file in binary(?).
Here is the code I'm using:
for(int k = 0; k < bits; k++)
{
myfile << bitArray[k];
}
myfile << "\n"; // Adds new line after the array is printed
Any ideas?
Thanks.