Does anyone know how to read the contents of a binary file into a static struct array, that can then be searched like a normal array?
MichaelSammels 0 Light Poster
Recommended Answers
Jump to PostSo the struct will need two members, something like:
struct mystruct { char name[20]; char passwrd[10]; }
Before main(), then in main(), create the struct itself:
struct mystruct mine[20];
and now you have an array of twenty records. Pass mine around like any other …
Jump to Postfread() to read binary records
fwrite() to write binary recordsWant an example of fread()?
Back in a sec.
All 7 Replies
Banfa 597 Posting Pro Featured Poster
MichaelSammels 0 Light Poster
Adak 419 Nearly a Posting Virtuoso
MichaelSammels 0 Light Poster
Adak 419 Nearly a Posting Virtuoso
MichaelSammels 0 Light Poster
Adak 419 Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.