fork download
  1. #include <stdio.h>
  2. #include <stdarg.h>
  3.  
  4. void foo( unsigned char a,
  5. unsigned char b,
  6. unsigned char c,
  7. ... )
  8. {
  9. va_list ap;
  10. unsigned char d;
  11. /*unsigned char *d = &a - 4;
  12.  
  13.   printf( "c: %p\nb: %p\na: %p\n",
  14.   (void *)&c,
  15.   (void *)&b,
  16.   (void *)&a );
  17.   printf( "d: %hhu\n",
  18. *d );*/
  19.  
  20. va_start( ap, c );
  21. d = va_arg( ap, unsigned int);
  22. va_end( ap );
  23. printf( "%hhu\n", d );
  24. }
  25.  
  26.  
  27.  
  28. int main(void)
  29. {
  30. foo( 1, 2, 3, 4 );
  31.  
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0.02s 1720KB
stdin
Standard input is empty
stdout
4