Originally Posted by ZuK
C suffers from the same problem:
void writeInt(int x)
FILE *f = fopen("int.txt", "a");
fprintf(f, "%d", x);
int x = -1;
FILE *f = fopen("int.txt", "r");
fscanf(f, "%d", &x);
printf("The first int written was: %d\n", readInt());
Elysia, I believe this is the kind of thing you're talking about, but I think you're putting too much demand on the standard IO functions.
The first int written was: 12
How does either the standard IO functions from C or C++ know 12 is really 1 and 2 written side by side if that is your format? If you put two UINT64 variables together side by side, how does it know that you've actually done that? Given text to read and convert to a numerical value, the standard library will do what it can based upon some rules to interpret that text. There's not much more you can ask of it.
Be explicit and make sure you know what you're doing when you come up with a file format.