hell all,
i have been searching for info on binary files but have not been able to find enough info to help me out with my project. could you please let me know of any good internet sources out there?
tnx
hell all,
i have been searching for info on binary files but have not been able to find enough info to help me out with my project. could you please let me know of any good internet sources out there?
tnx
What do you need to do with them?
-Prelude
My best code is written with the delete key.
hello ppl,
how do i connect database to the interface? is there a specific way of getting the two mixed up. ( i mean, when i receive input on the screen how do i save them into my binary files and the database)
(the interface is built by curses and ncurses and the software is for adding clients and getting there info).
I know this question might not make sense but i appreciate it if you could give me anytype of info(or maybe internet sources that i could refer to )
thanks,
Next time, reply to a thread, don't start a new one
From say
Which is an array of 200 elements, containing names and agesCode:struct { char name[10]; int age; } mydb[200];
To write to a file, do this
Reading is the reverseCode:FILE *fp = fopen("file.db","wb"); fwrite( mydb, sizeof(mydb[0]), 200, fp ); fclose( fp );
Code:FILE *fp = fopen("file.db","rb"); fread( mydb, sizeof(mydb[0]), 200, fp ); fclose( fp );