Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
struct AMG_ANGLES {
float yaw;
float pitch;
float roll;
};
int main() {
AMG_ANGLES struct_data;
struct_data.yaw = 87.96;
struct_data.pitch = -114.58;
struct_data.roll = 100.50;
//Sending Side
char b[sizeof(struct_data)];
memcpy(b, &struct_data, sizeof(struct_data));
//Receiving Side
AMG_ANGLES tmp; //Re-make the struct
memcpy(&tmp, b, sizeof(tmp));
cout << tmp.yaw; //Display the yaw to see if it's correct
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.