how do u deliminate files properly when writing so u can read them back in to the arrays they came from later.
my attemps so far have resulted in very joined up fields
how do u deliminate files properly when writing so u can read them back in to the arrays they came from later.
my attemps so far have resulted in very joined up fields
character, integer, float point array or what?
Last edited by no-one; 03-05-2002 at 11:59 PM.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
are you trying to deliminate files or tokenize a string in the program itself? If you're looking at the former, I find that the colon (:) makes a good delimiter. If you're trying to figure out the latter, post some code.
starX
www.axisoftime.com
im tring to write an array of a structure that contains strings and floats and ints.
well there are two plausible ways of doing this if your writing chunks of mixed data to a file,
1. everything has a predetermined size
this is good for pure data structures where you know what the exact size will always be,
the down side is you have limited space for strings that must always be written
2. Write the size of the struct in bytes to the file
write the size of the struct preceeding it in the file and read the size in, and then read the appropriate number of bytes stated by that size.
rinse and repeat!
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.