I usually send structures from arduino via serial port to PC and use the memcpy function to do it.
Let's say you have the struct data d:
struct data d;
len = sizeof(d);
char aux[len];
memcpy(&aux,&d,len);
Serial.write((uint8_t *)&aux,len);
It is useful to create a starting and ending character to delimit your important data and make sure you receive all data and good information.
Let me give you one of my recent work example:
...
void send_state(){
char aux[39];
memcpy(&aux, &state, Comm_size);
Serial.write('S');
Serial.write((uint8_t *)&aux, Comm_size);
Serial.write('E');
return;
}
...
In this example the struct state is preceded with "S" (start) and suceded with "E".
Then in python, for example, you can get the data using the unpack function. In my case:
...
# wait for data from arduino
myByte = port.read(1)
if myByte == 'S':
data = port.read(39)
myByte = port.read(1)
if myByte == 'E':
# is a valid message struct
new_values = unpack('<c6BH14B4f', data)
...
See if arduino sends data in little endian. The one I have used to send it.