Advertisement
Guest User

checkit for structs

a guest
May 10th, 2013
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "checkit.h"
  3.  
  4. typedef struct
  5. {
  6.    int speed;
  7.    double direction;
  8. } velocity;
  9.  
  10. velocity increase(velocity alpha)
  11. {
  12.     alpha.speed = alpha.speed + 10;
  13.     alpha.direction = alpha.direction + 1.0;
  14.     return alpha;
  15. }
  16.  
  17. int main(void)
  18. {
  19.     velocity bravo = {10, 150.0};
  20.     velocity charly;
  21.     charly = increase(bravo);
  22.     checkit_int(charly.speed, 20);
  23.     checkit_double(charly.direction, 151.0);
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement