Can anyone suggest a good method to store string objects to binary files? If we simply, store the string object, then when we need to read it, we won't know the length to read, right?
Currently, what I have is before storing each string, I store the length of the string as an int first... So, when reading the file, I read the int so I know the length of the string to be read.
Question is, Is this an efficient way to do it? Does anyone know of a better way? Thanks in advance.