So Ive got a struct of
struct records {
short link;
double gate;
unsigned char bar;
int rest;
char rink;
};
And now I want to read binary inputs and print them out using fread(). I'm just having trouble figuring out what exactly to do.
So I've only got
int main(int argc, char* argv[]){
}
So first off, how do you open a binary file? All the examples I've seen online only use main() and when using fopen() they always specify the input. How to use the command line arguments to specify which file to open?
And then, how do I read those files into the struct I've created and print them out?
Any help appreciated, thank you so much.
return 0;statement to return the result ofmain(). Hint 2: Once you made the changes of hint 1, set a breakpoint at the return statement and inspect the contents of argc and argv while supplying different command line arguments to the program.