Advertisement

fileformats

Started by November 11, 2001 10:41 AM
1 comment, last by hemp 23 years, 1 month ago
How do people make fileformats?
In C++ create a file handle with the following line

FILE *FFile = NULL;

Then open a file to save into or make a new file to save your settings etc into

FFIle = fopen("Filename","w");

Then write what you want from a buffer (ie struct, array, class etc)

fwrite(&Structure,sizeof(Structure),1,FFile);

Then close the file

fclose(FFile);
-----------------------------------------------------------------
In order to load the file back up

FILE *FFIle = NULL;
FFile = fopen("Filename","r");
fread(&Structure,sizeof(Structure),1,FFile);
fclose(FFIle);

http://kickme.to/BallisticPrograms
Advertisement
Send an email to wotsit.org and give it a name. Wait a few weeks, then you can download the specifications for it.

Kneelz

This topic is closed to new replies.

Advertisement