hai friends
i have difficulti in making a structure field....of strings with vairable length .....i think we should do with linked list right if not is there any other source to write variable length records
pls help me
regards
teja
hai friends
i have difficulti in making a structure field....of strings with vairable length .....i think we should do with linked list right if not is there any other source to write variable length records
pls help me
regards
teja
Variable length how?
Like:
record1:
joe
25
14 elm street
somecity, somestate 00010
cat
red
ford
record2:
bob
record3:
tom
1515 37th street east
somecity, somestate 12345-1222
dog
...OR...
Variable lengths of strings, but the record format is always the same:
record1:
10
Time flys when you're having fun
2.455
record2:
245
Time stands still.
354.1
record 3:
20
Once upon a time, in a land far far away, there lived a C programmer. It was his job to make wonderful programs for the king. All was well and happy in the land of the programmer, until one day, he forgot to initialize a pointer before using it. Much chaos ensued. The lone programmer set off on a quest to find the legendary 'debugger'. Many long nights later, the programmer mastered the 'debugger', and tracked down the nasty evil bug. All was happy in the land again. He lived happily ever after.
2345.0
In either case, there are a few ways to pull this off. If the first scenario, you could use a linked list which contains the "type", the "size", and the "data". Then make a keyword similar to what I've done with "recordX", and write it all that way. That's just one way to do it...
In the second, just write your structures all to one file, and your strings to another. (Or, write your structure to the file, next, write an integer which contains the size of the string, then write the string itself. Repeat.
There are many ways to do this. Clarify what you need.
Quzah.
Hope is the first step on the road to disappointment.