본문 바로가기
프로그래밍 C

쉽게 풀어쓴 C언어 익스프레스 10장 프로그래밍 4번

by MAKING CHA 2019. 11. 14.
반응형

#include <stdio.h>
#define SIZE 10

int array_copy(int a[], int b[], int size);

int main(void) {
int a[SIZE] = { 1,2,3,4,5,6,7,8,9 };
int b[SIZE] = { 0 };

array_copy(a, b, SIZE);

return 0;
}

void array_copy(int a[], int b[], int size) {
for (int i = 0; i < SIZE; i++) {
  b[i] = a[i];

  printf("%d", b[i]); 
}
}