I have a binary file generated by fortran code. This file contains an array of doubles. I need to open it in my C program and then work with it as with an usual array.
You can't, in principle.
The format of Fortran binary files is unspecified. That means that, although you can save program state in a Fortran binary file, and reopen it using the same Fortran implementation, you can't reliably do so even with a different Fortran implementation.
Now, there are a limited number of ways that one can sanely save state, so it's both possible and probable that you'd be able to work out the structure of a given Fortran binary file, in enough detail that you can open it in a C program and read the contents. However that knowledge is completely specific to the Fortran compiler in question.
So the best thing to do is to create a Fortran array containing, say, [0, 1, 2, 3, 4, 256, 65536, 65537, 1e10, 1e20, 1e30, 1e40]
, write it to a binary file, and look at it with a binary editor to see what's there.
After that, you're on your own I'm afraid....