Thread: Called Object type is not a function or function pointer (probably beginner mistake)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    7

    Called Object type is not a function or function pointer (probably beginner mistake)

    Hey guys, I've just started coding C about a week ago and I'm getting an error in two lines of code one saying "Called object type 'int' is not a function or function browser" and "Called object type 'int' is not a function or function browser". I'd like to know why that's happening in my program but also what that means in general. Another one that isn't actually failing the build is "Conversion specifies build type 'double' but the argument has type 'double *', and I was wondering what that means. All the errors are in the "a series" function. The point of the code in this section is to loop a certain number of times, (entered by the user(n)) adding a function during each iteration of the loop, with a time input (t). Thanks for the help. Here's the code
    Code:
    #include <stdio.h>
    #include <time.h>
    #include <math.h>
    #define pi 3.141593
    
    
    int aseries();
    int bseries();
    int cseries();
    
    
    int main()
    {
    //Beginning program stuff
    
        
    //Defining variables to find the time
        time_t now;
        time(&now);
        printf("%s\n", ctime(&now));
    printf("--------------------------------------------------------------\n");
        
    //Main Program
        char choice;
    printf("What type of evaluation would you like to perform?\n\t1.)Calculate voltage for a given value of time.\n\t2.)Input t and epsilon.\n\t3.)Find the change in voltage between t2 and t1.\nEnter '1' for choice one, '2' for choice two, or '3' for choice three: ");
        scanf("%d",&choice);
        
        if (choice == 1){
            aseries();
        }
    
    
        if (choice == 2){
            bseries();
        }
        
        if (choice == 3){
            cseries();
        }
        
        
        
        return 0;
    }
    
    
    int aseries()
    {
        
        double t;
        int n;
        double total=0;
        double v;
    
    
        
        
    //Prompting the user for time input
    printf("Enter the time you would like to evaluate the voltage at: ");
        scanf("%lf",&t);
        
    //Prompting the user for number of terms in the series
    printf("Enter the number of terms in the series you would like: ");
        scanf("%lf",&n);
        
    //Building the series
        
        for (int i=0;i<=n;i++){
          total = total + ((1/((2(i)-1)^2))*cos(((2(i)-1)*pi*t)/3)) //This is where the "Called object type 'int'..." error is 
            
        }
        
        v=(3/2)-(12/pow(pi,2))(total); //This is where the "Called object type 'double'..." error is 
        
        printf("%lf",&v); //This is where the "Conversion specifics type..." error is 
        
        
        
        
        
        return 0 ;   
    
    
    }
    
    
    int bseries()
    {
        double t;
        double e;
        
    //Prompting the user for time input
    printf("Enter the time you would like to evaluate the voltage at: ");
        scanf("%lf",&t);
        
    //Prompting the user for epsilon input
    printf("Enter the epsilon value you would like to use: ");
        scanf("%lf",&e);
        
        
        
        return 0;
        
    
    
        
    }
    
    
    int cseries()
    {
        double t1;
        double t2;
        int n;
        
        
    //Prompt the user for time inputs
    printf("Enter the beginning of the time you would like to evaluate the voltage at: ");
        scanf("%lf",&t1);
    
    
    printf("Enter the end of the time you would like to evaluate the voltage at: ");
        scanf("%lf",&t2);
    
    
    //Prompting the user for number of terms in the series
    printf("Enter the number of terms in the series you would like: ");
        scanf("%lf",&n);
        
        return 0;
        
    }
    Last edited by Ethan_K; 03-18-2012 at 09:43 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. called object is not a function
    By tetartos in forum C Programming
    Replies: 3
    Last Post: 11-27-2011, 12:23 PM
  2. Getting Error: Called Object is not a Function
    By Ketsueki in forum C Programming
    Replies: 3
    Last Post: 06-23-2010, 05:51 AM
  3. Replies: 2
    Last Post: 08-02-2008, 09:38 PM
  4. error: called object is not a function
    By sweetorangepie in forum C Programming
    Replies: 3
    Last Post: 03-20-2008, 06:47 PM
  5. error: called object is not a function
    By yougene in forum C Programming
    Replies: 1
    Last Post: 07-24-2007, 09:32 PM