I'm currently working on a program for a C course in which I have to output the area of a shape.
Here is a function for a rectangle's area that I have in my program:
double rectangle() // calculate area of rectangle
{
double length, width;
printf("\nEnter length and width of rectangle: ");
scanf("%g %g\n", &length, &width);
return (length*width);
}
here is where I call the function rectangle()
if(strncmp(shape, "rectangle", 15) == 0)
area = rectangle();
I'm using Geany in Linux Mint with the GCC compiler.
The error I'm recieving is
"geometryv2.c:78: error: conflicting types for ‘rectangle’"
I don't see what's conflicting here. The function with return-type double is returning a double. Any help here would be greatly appreciated. I am still pretty new to C and this is actually my first C program.
Thanks!