fork download
  1. #include <stdio.h>
  2.  
  3. void foo( unsigned char a,
  4. unsigned char b,
  5. unsigned char c,
  6. ... )
  7. {
  8. printf( "a: %p\nb: %p\nc: %p\n",
  9. (void *)&a,
  10. (void *)&b,
  11. (void *)&c );
  12.  
  13. printf( "d1: %hhu\n", *(&c - 8) );
  14. printf( "d2: %hhu\n", *(&c - 4) );
  15. printf( "d3: %hhu\n", *(&c + 4) );
  16. printf( "d4: %hhu\n", *(&c + 8) );
  17. printf( "d5: %hhu\n", *(&c + 12) );
  18. printf( "d6: %hhu\n", *(&c + 16) );
  19.  
  20. }
  21.  
  22.  
  23.  
  24. int main(void)
  25. {
  26. foo( 1, 2, 3, 4 );
  27.  
  28.  
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
a: 0xbf9ab408
b: 0xbf9ab404
c: 0xbf9ab400
d1: 4
d2: 0
d3: 2
d4: 1
d5: 71
d6: 1