1,105,290 Community Members

Method keeps resulting in error

Member Avatar
Magda6347
Newbie Poster
8 posts since Oct 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Dec 7, 2012 at 11:18pm

Im trying to create a bank account. In the bank account the user creates an account and puts whatever amount they want to open account. after account is created they can go to withdraw or deposit and add or subtract additional monty from the account. Im trying to use a method for the deposits but I keep getting an error"error C2064: term does not evaluate to a function taking 1 arguments" and Im not sure exactly what the problem is. I know the deposit has to be added to the balance and the balance needs to be updated but I cant even get to that point. Im using Visual Studio 2010 Window forms application,here is the code I'm entering.

    if (tabControl1->SelectedTab == tabPage2)
             { 

            double depamount;
            double BalDep;
            double FindDepBal;
            BalDep = (bal - depamount);
            Double::TryParse(txtDeposit->Text, depamount);
            FindDepBal(BalDep);
            lblBal->Text = FindDepBal.ToString();


            txtDeposit->Text = BalDep.ToString();
Member Avatar
Prysm[VA]
Newbie Poster
21 posts since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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

This error is telling me that you are either sending in too little variables or too many variables into that function/method.

Member Avatar
ravenous
Practically a Master Poster
682 posts since Jul 2005
Reputation Points: 251 [?]
Q&As Helped to Solve: 112 [?]
Skill Endorsements: 13 [?]
 
0
 

Your problem is line 9 (in your snippet). The expression

FindDepBal(BalDep);

doesn't make sense. You can only use this notation when constructing a double. So, for example, you could do

double FindDepBal( BalDep );   // Construct with value

or

FindDepBal = BalDep;           // Assign new value

The way you currently have it, the compiler is trying to treat FinalDepBal as a function (which it things might take one argument, BalDep), which is what the error is about. Google the error code and find this page.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article