daily pastebin goal
80%
SHARE
TWEET

checkit for structs

a guest May 10th, 2013 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
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
 
Top