![]() |
| ||
| error C2064: term does not evaluate to a function taking 1 arguments Hi, I'm using Microsoft Visual C++ and I keep getting this error referring to this one line in my main file. The line of error is in bold. Header file [php] int f (int n); double e (double accuracy); double exp (double expo, double exaccuracy); [/php] Computation file [php] #include "wong_header.h" int f(int n) { int t = 1; while (n >= 1) { t = t * n--; } return t; } double e (double accuracy) { accuracy = accuracy - 1; double fac = 1; double ee = 0; while (accuracy >= 1) { fac = fac * accuracy; ee = ee + (1/(fac)); accuracy--; } return ee; } double exp (double expo, int exaccuracy) { exaccuracy = exaccuracy - 1; double value; double fact = 1; double exo = 0; while ((expo >=0)&&(exaccuracy >=1)) { value = expo * exaccuracy; fact = fact * exaccuracy; exo = exo + (value/fact); exaccuracy--; } return exo; } [/php] main file #include <iostream> Can someone help me figure out what I'm doing wrong? |
| ||
| Re: error C2064: term does not evaluate to a function taking 1 arguments which line is in bold ? they all look bold to me. how about adding some comments that point to the line ... <<< this line is the error I think its better to use code tags when posting code, not php tags. |
| ||
| Re: error C2064: term does not evaluate to a function taking 1 arguments Sorry, here it the main file again: #include <iostream> |
| ||
| Re: error C2064: term does not evaluate to a function taking 1 arguments int f = atoi (command.c_str());Since you have a local variable called f, you can't call the function f(). Give them different names, like f_ret and func(). |
| ||
| Re: error C2064: term does not evaluate to a function taking 1 arguments thanks :) |
| ||
| Re: error C2064: term does not evaluate to a function taking 1 arguments Heh, that was post 100 for him. I feel so honored. It's not reading the input.txt file though. Where do I put the input fine so my program can read it? |
| ||
| Re: error C2064: term does not evaluate to a function taking 1 arguments Generally, your input.txt should go in the same place as your executable. If for some reason, this is causing you problems, or you do not know where the executable is, refer to the complete path of the txt file explicitly, for example, in DOS/Windows, you'd use ifstream fin ("C:\\MyProgram\\input.txt"); the double-backslash is necessary, since the file location is a string (and '\\' is the escape character for a single backslash) |
| ||
| Re: error C2064: term does not evaluate to a function taking 1 arguments Thanks, but I already handed my project in... incorrectly. I probably got probably (grade < 70) { cout << "Isuck because you failed" <<endl; } |
| All times are GMT -4. The time now is 5:54 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC