That converted an array of characters which was unfortunately not what I needed, I did figure it out today eventually though this is how I converted a object into binary:
- First prompt user for file path
- Then use fwrite command to write the binary file, pointing it to the begining of the object and giving it the object's size.
if (FileSelectPopup (proj_dir, "*.bn", "*.bn","Name of File to Save", VAL_OK_BUTTON, 0, 1, 1,0, file_name) > 0)
{
pFile = fopen (file_name, "wb");
fwrite ((char *)(&object_name), 1, sizeof(object_name), pFile);
}