Posted by: lootekukur July 14, 2007
c++ question to programmers ----
Login in to Rate this Post:     0       ?        
looks like ^ bro overtook me hehe. but since i put my 5 mins into it, here's how i would write numeric values to a binary file :P ======== #include #define size 3 int main () { FILE * pFile; struct var{ double x1; double x2; }; typedef struct var var; var vararr[size]={{3.4,4.5},{5.4,6.1},{7.1,8.9}}; pFile = fopen ( "file.bin" , "wb" ); fwrite (vararr , sizeof(var) , size , pFile ); fclose (pFile); return 0; } ======
Read Full Discussion Thread for this article