fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. static char csv_tmp[100];
  5.  
  6. int main(void) {
  7. char buff[3][4] = { "abc", "def", "ghi" };
  8.  
  9. for ( int i = 0; i<3; i++ )
  10. {
  11. sprintf((char *)&csv_tmp[0], "%s, %s", csv_tmp, buff[i]);
  12. printf("%s\n", csv_tmp);
  13. }
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
, abc
, abc, def
, abc, def, ghi