c++ - Bank Account Program Issues with build and getting started -


onto program. program simulates bank account. need showing of balance, withdraw, , deposit. how show final balance after withdraw/deposit?

#include <iostream> #include <string> #include "baccount.h"      using namespace std;     int main ()     {         double amount = 0.0;         double withrdraw = 0.0;         double deposit = 0.0;         string name;         double startamount = 100.00;         double balance = 0.0;           cout << "name: ";         cin >> name;          cout << "initial balance: " << startamount <<endl;           cout << "deposit? ";         cin >> amount;         cout << "withdraw? ";         cin >> amount;           cout << "balance " << name  << " " << balance << endl;          system ("pause");          return 0;     } 

cout << "balance " << name () << " " << balance()     <<endl; 

by putting parenthesis after them, you're trying call name , balance functions, they're strings. remove parenthesis.

more importantly, made think had to include parenthesis there? there may fundamental piece of c++ you're confused (functions) should seek understand.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -