fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int data[] = {12, 345, 6789, 101112};
  5. char buf[128], *pos = buf;
  6. for (int i = 0 ; i < 4 ; i++) {
  7. if (i) {
  8. pos += sprintf(pos, ", ");
  9. }
  10. pos += sprintf(pos, "%d", data[i]);
  11. }
  12. printf("%s\n", buf);
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
12, 345, 6789, 101112