the two most common reasons for the conflict types of error
first, mismatch of return type b/w function prototype declaration and the function declaration
the second is a mismatch of function parameters type b/w function prototype declaration and the function declaration
let’s see an example
#include <stdio.h>
#include <stdlib.h>
int calsum(int x, int y);//function prototype declaration
int main()
{
int a=1,b=2,sum;
sum=calsum(a,b); // function call
printf("sum=%d\n",sum);
return 0;
}
int calsum(int x, int y) //function declaration
{
int d;
d=x+y;
return(d);
}
always make sure your function prototype declaration and function declaration should match with the same number of arguments with the same type and the same return type of function
Leave a Reply