|
I am having a hard time understand writing and reading files. i have read a lot of literature but i can't seem to find the answers i'm looking for.
some facts; lets say i am writing a file of 5 records in an array. each record has 3 elements. let say i write the file with each element as a string. now my question;
1. without knowing how the file was written (ie...string, int, char, double) or the name of the element (or the format of those elements), but i do know the number of records and what each element (but not the order of these elements) are. how can you read a file in a program and load it into an array?
2. i assume when the file is written some tags are attached to each element but just not displayed in the .dat file?
i wrote a file like this and this was the dat in the .dat file;
1111frank26354 9847tom37374 5343hank1324
etc.... is this how a program writes a file?
i hope i am making sense.
|