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 PostAn array of structures with what members?
If you do not know the format of the binary file about the best you can do is read it into an array of char.
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 …
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.