fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int DataSize = 3;
  6. char *str = (char *) malloc(sizeof(char) * 20);
  7. char *pstr = str;
  8. for(int i = 0; i < DataSize; i++)
  9. {
  10. pstr += sprintf(pstr, "%x ", i);
  11. }
  12. printf("%s", str);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5264KB
stdin
Standard input is empty
stdout
0 1 2