Advertisement
ijontichy

derp.c

Aug 15th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.     float derp;
  8.     int   herp;
  9.     int   nerp;
  10.  
  11.     derp = 4.0;
  12.     herp = (int)derp;
  13.     memcpy(&nerp, &derp, sizeof(int));
  14.  
  15.     printf("derp = %f\n", derp);
  16.     printf("herp = %d\n", herp);
  17.     printf("nerp = %d\n", nerp);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement