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

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

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

#include <stdio.h>

#include <stdlib.h> 
#include <time.h>

#define SIZE 10 


void array_fill(int *A, int size); 

int main(void) { 
int A[SIZE] = { 0 }; 
array_fill(A, SIZE); 

} 

void array_fill(int *A, int size) { 

int i; 
srand((unsigned)time(NULL)); 

for (i = 0; i < size; i++) { 
A[i] = rand(); 
printf("%d ", A[i]); 
} 


}