Hi. I don't know why I am so confused by this, it should be simple.
I want to be able to write text to a file that would be recognized by humans. I have a small program that writes a floating point value to a file. However, the text file that is created has in it something that is not in human readable form. Does this mean that I can only write values of type "char" to a file so that they are human readable? If that is the case then should I typecast this value before writing it to the file?
float rval = 4.7;
FILE *fptr;
fptr = fopen("text.txt", "w");
fwrite(&rval,1,sizeof(rval),fptr);
fclose(fptr);