I have char array, and i want to write it to txt file, but in bytes.
ofstream sw("C:\\Test.txt");
for(int i = 0; i < 256; i++)
{
sw << (byte)myArray[i];
}
This will write chars into the file, but i want to write bytes. If there is char ‘a’ i want to write ’97’. Thank you.
This will convert a char ‘a’ to an int(or byte) value 97.