0

I have a binary file and i use this code to read it.

FILE * File;
long Size;
char * buffer;
size_t result;

File = fopen ( "STUD.bin" , "rb" );
fseek (File , 0 , SEEK_END);
Size = ftell (File);
rewind (File);
buffer = (char*) malloc (sizeof(char)*Size);
result = fread (buffer,1,Size,File);

Ii want to use those structures from the binary file. What code should i use for that?

1 Answer 1

1

Your question seems a little unclear. But if the case is that you have a structure in the binary file and want to read it then do the following

    struct example abc;
    fread(&abc,sizeof(abc),1,File);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.