Thread: "error C2064: term does not evaluate to a function taking 1 arguments"

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    4

    "error C2064: term does not evaluate to a function taking 1 arguments"

    Hello
    I just wrote this very simple program but i got the error "error C2064: term does not evaluate to a function taking 1 arguments", what in my program is wrong?
    here it is:

    Code:
     
    //**********************************************************************
    #include<stdio.h>
    #include<conio.h>
    int main()
    {
    int i;
    double x[19],tn;
    for(i=0;i<19;i++)
    {
    x(i)=1;
    //tn=x(i);
    }
    return 0;
    }

    and here is the error (when i double click on the error given below pointer goes to line 10,x(i)=1; )


    ------ Build started: Project: yj, Configuration: Debug Win32 ------
    Compiling...
    3.cpp
    f:\my project\yj\yj\3.cpp(9) : error C2064: term does not evaluate to a function taking 1 arguments
    Build log was saved at "file://f:\my project\yj\yj\Debug\BuildLog.htm"
    yj - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========




    thanks in advance
    Last edited by gholamghar; 03-31-2010 at 04:19 AM.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    x(i) should be x[i].

    By the way, is this supposed to be C or C++?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    4
    It is c++.I use microsoft visual studio 2008.

  4. #4
    Registered User
    Join Date
    Mar 2010
    Posts
    4

    Problem solved

    Thank you,you are right,i am working with fortran and c++ together right now,and it was my fault that confused the way an array is written in fortran and in c++.thank you very much for you very quick response.
    Last edited by gholamghar; 03-31-2010 at 04:42 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  4. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 09:10 AM
  5. C++ compilation issues
    By Rupan in forum C++ Programming
    Replies: 1
    Last Post: 08-22-2005, 05:45 AM