How to save array to a file.
Thanks in advance.
How to save array to a file.
Thanks in advance.
Same way as a non array type.
Last edited by prog-bman; 02-23-2005 at 11:08 PM.
Woop?
To expand slightly:
a) Loop through the array, saving each element:
b) Save the whole thing at once. (Binary files only. No arrays of pointers.)Code:for( x = 0; x < numelements; x++ ) ...save this element, your method of choice, many choices...
c) Think up some other fun way on your own.Code:fwrite( arrayname, sizeof( oneelement ), numelements, outputfile );
Quzah.
Hope is the first step on the road to disappointment.
I think that the best way is too went on this page and look!
All you can do with printing into file! And how to! with examples!
Sorry for spelling errors, not English!
xxxrugby: "All Human Race Will Die From My Hand!"
xxxrugby: "We are all philosophers, when question is about politics!"