when i compile a simple program in Dev C++ i get error:" conflicting types for 'myf' "

#include <stdio.h>
#include <stdlib.h>
int main()
{
myf(3.0); 
return 0;
}

double myf(double x)
{ 
return x; 
}

what does that mean?

Ancient Dragon commented: thanks for using code tags +8

you failed to prototype function myf() before it was used, so the compiler make an incorrect assumption that it returned an int. Add the function prototype double myf(double x); before function main but after the includes.

And thank you for using code tags to make your code easy to read.:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.