fork download
  1. #define _GNU_SOURCE
  2. #include <argp.h>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <stdbool.h>
  6. #include <float.h>
  7. #include <math.h>
  8. #include <string.h>
  9.  
  10. int main(void) {
  11. char *english[] = {"zero", "one", "two", "three", "four", "five",
  12. "six", "seven", "eight", "nine"};
  13. char *l_english = malloc(5*sizeof(char)*10+10+1);
  14. char *ptr_eng = l_english;
  15. int i;
  16. for(i = 0; i<10; i++){
  17. ptr_eng = mempcpy(ptr_eng,english[i],strlen(english[i]));
  18. printf("Iteration %d\n",i);
  19. }
  20. free(l_english);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 2380KB
stdin
Standard input is empty
stdout
Iteration 0
Iteration 1
Iteration 2
Iteration 3
Iteration 4
Iteration 5
Iteration 6
Iteration 7
Iteration 8
Iteration 9