//함수에 배열전달하기
#include <stdio.h>
#define MAX 10
int array[MAX] , count ;
int largest( int x[] , int y );
main()
{
//키보드에서 MAX값을 얻는다
for (count = 0 ; count < MAX ; count ++ )
{
printf("\nEnter an integer value: ");
scanf("%d",array[count]);
}
printf("\n\nLargest value is %d", largest (array , MAX)); // 질문!! 여기서 왜 array 가들어가죠?
return 0;
}
int largest(int x[] , int y)
{
int count, biggest = -12000 ;
for (count=0 ; count < y ; count++)
{
if(x[count] > biggest) // 여기서 무슨뜻인지 모르겠어여
biggest = x[count];
}
return biggest ;
}
===================
c언어 배운지 얼마안됬어요..
아무리 생각해도 잘 모르겠습니다
답변부탁드려요
|