Please help me to solve the error main.c:18:8: error: called object ‘sum’ is not a function or function pointer, below is the code:
#include<stdio.h>
int sum(int*a,int*b)
{
int s=0;
s=*a=*b;
return s ;
}
int main()
{
int num1=10 , num2=20 ,*ptr1 ,*ptr2 ,sum=0 ;
ptr1=&num1;
ptr2=&num2;
sum = sum(*ptr1,*ptr2);
printf("sum of two variables is %d",sum);
return 0;
}
0 Answer(s)