944,137 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 1871
  • C RSS
Oct 3rd, 2006
0

Gettin C2064 error on a pretty simple program...Please help!!

Expand Post »
I keep on getting the erro "error C2064: term does not evaluate to a function taking 1 arguments" I have three of these errors and they are all on the first line after the if statements. I really dont know what is going wrong. Been working on this error for about 2 hours now. Please help!!
Attached Files
File Type: cpp Lab 5 (problrm 1).cpp (1.5 KB, 30 views)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zac_haryy is offline Offline
5 posts
since Oct 2006
Oct 3rd, 2006
0

Re: Gettin C2064 error on a pretty simple program...Please help!!

you can not use the name of functions as the name of a variables. Function names must be different from variable names. Example: residential_rate is used both as a function name and a variable name, and since the variable name is in _tmain() the compiler is treating that symble as a float, not a function.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Oct 3rd, 2006
1

Re: Gettin C2064 error on a pretty simple program...Please help!!

You are declaring functions residential_rate(), commercial_rate(), industrial_rate() also as floats of the same name in function main(). Remove those variables and it will work!

Oops, I was too slow! Sorry Mister Dragon near St Louis!
Last edited by vegaseat; Oct 3rd, 2006 at 7:38 pm.
Moderator
Reputation Points: 1333
Solved Threads: 1404
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Oct 3rd, 2006
0

Re: Gettin C2064 error on a pretty simple program...Please help!!

Everything worked great after taking the functions out of the identifier. Thanks!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zac_haryy is offline Offline
5 posts
since Oct 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: a simple question
Next Thread in C Forum Timeline: enquiry





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC