Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define INT 100
  4.  
  5.  
  6. typedef struct _TOTO TOTO;
  7.  
  8. void test_func(TOTO* toto, double a);
  9.  
  10.  
  11. struct _TOTO {
  12. int b;
  13. int c;
  14. };
  15.  
  16. void test_func(TOTO* toto,double a)
  17. {
  18.  
  19. toto->c=a;
  20.  
  21. toto->b=a*INT;
  22. printf("b=%d\n",toto->b);
  23.  
  24. }
  25.  
  26. int main(int argc, char* argv[])
  27. {
  28. double a=0.1f;
  29. TOTO* toto = malloc(sizeof(TOTO));
  30.  
  31. test_func(toto,a);
  32.  
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement