September 27th, 2003, 01:06 PM
ahhhhh.! don't understand this one error
//Sept. 18, 2003
using namespace std;
cout<<"address of a"<<pa;
cout<<"contents of *pa"<<*pa;
int V= mul(&a, &b);
int mul(int *pta, int*ptb)
Line 21: error C2064: term does not evaluate to a function...:rolleyes:
September 27th, 2003, 01:32 PM
Maybe your compiler is getting confused by this statement:
Try rewriting this as:
int c = (*pta) * (*ptb);
int c = *pta * *ptr;
Spaces are a good thing :)
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
September 27th, 2003, 05:02 PM
In line 21, you are calling mul() before it is declared or defined. There are two ways around this.
1) Define mul() ahead of main().
2) Forward declare mul() by adding the following before main():
Scorpions4ever 's suggestion is not the answer, but he is right, your code layout sucks and your use of whitspace is inconsistent. Also remembering to post in code tags will aid readability.
int mul( int* pta, int* ptb ) ;
And another point to save me counting lines and hoping that you have not missed out lines, please indicate the line for which the error was reported in the code, in this case line 21.
September 27th, 2003, 05:10 PM
It still doens't work. the problem is in line 22, which is..
int V= mul(&a, &b);
error C2064: term does not evaluate to a function
September 27th, 2003, 11:26 PM
You have a variable with the same name as your function. The strange thing is.. that variable is never even used.
Make the changes that clifford suggested and then take this line out of your main function:
And it should work.
September 28th, 2003, 02:20 AM
Also you need to forward declare mul().
September 28th, 2003, 07:24 AM