> Why does not my program work?

Why does not my program work?

Posted at: 2014-12-18 
Looks like you defined a function prototype "int min();" So that the function min does not have any arguments.

Then in the printf you reference a function called min which takes an integer array as an argument. But you never declared a function prototype for that version of min.

#include

#include

#include

#include

#include

int main(void){

int arr[] = {2,3,6,9,2};

int min();

printf("Minimum = %d\n",min(arr)); *//Error - undefined reference to `min'

return 0;

}

This program should calculate the minimum value in a array. Im using Eclipse on windows 7.