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

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Oct 2006
Posts: 5
Reputation: zac_haryy is an unknown quantity at this point 
Solved Threads: 0
zac_haryy zac_haryy is offline Offline
Newbie Poster

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

 
0
  #1
Oct 3rd, 2006
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, 6 views)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,626
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1496
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

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

 
0
  #2
Oct 3rd, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,125
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 944
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

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

 
1
  #3
Oct 3rd, 2006
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.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 5
Reputation: zac_haryy is an unknown quantity at this point 
Solved Threads: 0
zac_haryy zac_haryy is offline Offline
Newbie Poster

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

 
0
  #4
Oct 3rd, 2006
Everything worked great after taking the functions out of the identifier. Thanks!!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC