-
-
Save jgrar/9258267 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct ret | |
{ | |
char *id; | |
int accel_x; | |
int accel_y; | |
int accel_z; | |
int gyro_x; | |
int gyro_y; | |
int gyro_z; | |
}; | |
struct ret ret_init (char *id, int accel_x, int accel_y, int accel_z, int gyro_x, int gyro_y, int gyro_z) { | |
struct ret r; | |
r.id = id; | |
r.accel_x = accel_x; | |
r.accel_y = accel_y; | |
r.accel_z = accel_z; | |
r.gyro_x = gyro_x; | |
r.gyro_y = gyro_y; | |
r.gyro_z = gyro_z; | |
return r; | |
} | |
int main() | |
{ | |
struct ret ret; | |
ret = ret_init("foo", 1, 2, 3, 1, 3, 2); | |
printf("%s %d %d %d %d %d %d\n", ret.id, ret.accel_x, ret.accel_y, ret.accel_z, ret.gyro_x, ret.gyro_y, ret.gyro_z); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment