Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "checkit.h"
- typedef struct
- {
- int speed;
- double direction;
- } velocity;
- velocity increase(velocity alpha)
- {
- alpha.speed = alpha.speed + 10;
- alpha.direction = alpha.direction + 1.0;
- return alpha;
- }
- int main(void)
- {
- velocity bravo = {10, 150.0};
- velocity charly;
- charly = increase(bravo);
- checkit_int(charly.speed, 20);
- checkit_double(charly.direction, 151.0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement