Advertisement

How do you write a array to a file?

Started by August 04, 2000 04:58 PM
0 comments, last by JSCFaith 24 years, 4 months ago
Hey, Well I can''t figure out how to use ReadFile and WriteFile to write and read a map array like this "map[42][42]" from a file, how would I go about reading and writing that to a file, thanks. James.
well the way i do it, using the old C libraries (which works just fine is)

int map[42][42];// to read from fileFILE *ff = fopen ("filename.file", "r");fread (map, 42*42, sizeof(int), f);fclose(f);// to write to filef = fopen ("filename.file", "w");fwrite (map, 42*42, sizeof(int), f);fclose(f); 


simple!
[email=ehremo@hotmail.com][/email]

This topic is closed to new replies.

Advertisement