C Newbie problems with functions (I think)
Why?
Code:
#include <stdio.h>
#include <math.h>
int main(void)
{
float x;
float round(float number);
while(1)
{
printf("Enter a number");
scanf("%f", &x);
printf("round(%f) = %f", x, round(x));
}
return 0;
}
float round(float number)
{
return floor(number +.5);
}
gcc ...
Code:
05_10.c: In function ‘main’:
05_10.c:8: warning: conflicting types for built-in function ‘round’
/tmp/ccgnH0xg.o: In function `round':
05_10.c:(.text+0x6b): undefined reference to `floor'
collect2: ld returned 1 exit status
Thanks in advance