Home:ALL Converter>How to write a binary struct using python that can be read in c?

How to write a binary struct using python that can be read in c?

Ask Time:2012-12-14T18:55:45         Author:steave

Json Formatter

say a struct like this:

typedef struct testVertex_s {
       char *vert_name; //for test only...
       float x;
       float y;
       float z;
}testvertex_t;

how to write that to a binary file use python ? I want to read it using fread in c;

Author:steave,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13877286/how-to-write-a-binary-struct-using-python-that-can-be-read-in-c
yy