SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct AMG_ANGLES {
  2.     float yaw;
  3.     float pitch;
  4.     float roll;
  5. };
  6.  
  7. int main() {
  8.     AMG_ANGLES struct_data;
  9.  
  10.     struct_data.yaw = 87.96;
  11.     struct_data.pitch = -114.58;
  12.     struct_data.roll = 100.50;
  13.  
  14.     //Sending Side
  15.     char b[sizeof(struct_data)];
  16.     memcpy(b, &struct_data, sizeof(struct_data));
  17.  
  18.     //Receiving Side
  19.     AMG_ANGLES tmp; //Re-make the struct
  20.     memcpy(&tmp, b, sizeof(tmp));
  21.     cout << tmp.yaw; //Display the yaw to see if it's correct
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top