fork download
  1. #include <stdio.h>
  2. unsigned long press_events[] = {1, 2, 3 ,4};
  3.  
  4. void print_event_queue() {
  5. char buff[256], *pos = buff;
  6. for(int i = 0; i < 127; i++) {
  7. if(press_events[i]) {
  8. pos += sprintf(pos, " %lu", press_events[i]);
  9. }
  10. }
  11. printf("%s", buff);
  12. }
  13.  
  14.  
  15. int main(void) {
  16. print_event_queue();
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5268KB
stdin
Standard input is empty
stdout
 1 2 3 4