fork download
  1. #include <inttypes.h>
  2. #include <stdint.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. typedef struct TEST { int X; int Y; } Punto;
  7. typedef struct TEST2 { int64_t Z; } Direccion;
  8.  
  9. int main(void) {
  10. Punto N = { .X = 0xAAAA1000, .Y = 0xBBBB1000 };
  11. Direccion *Dir = (Direccion *)&N; /* Obligamos a cambiar el tipo de N. */
  12.  
  13. printf("Punto.X: 0x%08X, Punto.Y: 0x%08X\n", N.X, N.Y);
  14. printf("Dir.Z: 0x%016" PRIx64 "\n", Dir->Z);
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
Punto.X: 0xAAAA1000, Punto.Y: 0xBBBB1000
Dir.Z: 0xbbbb1000aaaa1000