Advertisement
image28

double-memcpy-test.c

Jun 20th, 2022 (edited)
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. // image28
  2. // gcc ptr-test.c -ffloat-store --std=c99 -o ptr-test
  3. // Still no luck there 000000M000000
  4.  
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <stdlib.h>
  8.  
  9. int main()
  10. {
  11.     unsigned int a[2];
  12.     void *d;
  13.    
  14.     d=calloc(1,8);
  15.  
  16.     for(a[0]=0; a[0]<256; a[0]++)
  17.     {
  18.         memcpy(d,&a,8);
  19.  
  20.         for(a[1]=0; a[1]<256; a[1]++)
  21.         {
  22.             printf("%u.%u %lf\n",a[0],a[1],(double *)d);   // OOOOOOMOOOOOOO
  23.  
  24.         }
  25.        
  26.     }
  27.    
  28.     return(0);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement