1.11M Members

Method keeps resulting in error

 
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();
 
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.

 
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 six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article