fork download
  1. #include<stdio.h>
  2. #define OWARI -999
  3. #define SIZE 30
  4.  
  5. void arraycopy(int* a, int* b){
  6. int i = 0;
  7. do{
  8. b[i] = a[i];
  9. }while(a[i++] != OWARI);
  10. }
  11. void arrayshow(int* a){
  12. int i = 0;
  13. do{
  14. printf("%d, ", a[i]);
  15. }while(a[i++] != OWARI);
  16. printf("\n");
  17. }
  18. int main(void){
  19. int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, OWARI};
  20. int b[SIZE];
  21.  
  22. arraycopy(a, b);
  23. arrayshow(b);
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0s 5460KB
stdin
Standard input is empty
stdout
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -999,