Hi everyone. I'd like to ask if there is a way to write characters beyond 127 with 1 byte? I got a file which was saved in such a way, But I can not write back in the same way. So to speak, if I use "fread" to read in the file byte by byte, at some of them it is a number larger than 127. As shown in the code, if I write a character by 128, it became a 2 bytes (fread get back 2 numbers). How would I write it in order to get also 1 byte 128 back?
fid=fopen('test','w')fprintf(char(128))fclose(fid)fid=fopen('test','r')test=fread(fid)fclose(fid)
Best Answer