Thread: Conflicting Types for function

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    26

    Conflicting Types for function

    I'm trying to compile my program but am constantly getting the same error. on compiling the message is: "error: conflicting types for 'evaluate'"
    "note: previous declaration of 'evaluate' was here" (with line pointer)

    Both these lines say "double evaluate(....)" but it still won't work. I'll post the outline below. What am I missing?

    Code:
    /* Prototype function */
    double evaluate(double x[], double fx[], long int MAX_ROWS, double a, double b, double eval);
    
    int main(int argc, char* argv[])
    {
    ...
    ...
    ...
    }
    
    double evaluate(double xs[], double fxs[], long int MAX_ROW, double aa, double bb, double *eval)
    {
    ...
    ...
    ...
    }

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Apart from the names (which don't matter), the rest of it has to be the same. Since it's not .... (Hint: "double *" and "double" are not the same thing.)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. conflicting types for getline() fix
    By saqib_ in forum C Programming
    Replies: 4
    Last Post: 04-05-2010, 04:04 AM
  2. Replies: 6
    Last Post: 08-23-2008, 01:16 PM
  3. The Interactive Animation - my first released C program
    By ulillillia in forum A Brief History of Cprogramming.com
    Replies: 48
    Last Post: 05-10-2007, 02:25 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. conflicting types for...
    By dudinka in forum C Programming
    Replies: 3
    Last Post: 05-14-2005, 07:03 AM