Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • main.c:18:8: error: called object sum is not a function or function pointer

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 17
    Answer it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: