The answer for C++ is here: How to check if C++ compiler uses IEEE 754 floating point standard
For C, Annex F of the current C Standard specifies that the preprocessor constant __STDC_IEC_559__
will be pre-defined to the value 1
if the platform conforms to the IEEE 754 specification for floating point arithmetic. But older C compilers may not pre-define it even if floats are indeed IEEE 754.
Yet this is not enough for either language: this conformity only guarantees the semantics of IEEE 754, not the binary representation, and since you are dumping the binary representation to a file, you would also need to handle the endianness issue. It becomes even more complicated as endianness for integers may differ from the endianness for floats.
In the end, it is much better to use a textual representation to store your floating point values if you wish to achieve portability between various platforms, present and future. Of course, you will need to use the maximum precision for this representation.
Another solution is provided by http://hdfgroup.org that handle this very problem efficiently for large quantities of data.