previous implicit declaration of `regre` was here
If the function is unknown, the compiler defaults to its int functionname() . In your case, int regre() will be declared here.
conflicting types for 'regre'
When your actual double regre() function is noticed, this conflict error occurs. To solve this problem, you must declare a double regre () function before actually using it.
#include<stdio.h> double regre(); //Forward Declaration int main(){ double returning; returning = regre(); printf("%f", returning); return 0; } double regre(){ double re = 14.35; return re; }
For more information about forward declaration, see the following link.
http://en.wikipedia.org/wiki/Forward_declaration
source share