Hello,
I am trying to convert a regular class to a templated one.
I thought this would be simple enough, but now I my functions do not compile.
Where have I cone wrong?
~~ Program Body ~~Code:template<class T> class BankAccount { private: string CustFirst; string CustLast; int CustAccNum; int PinNum; T AccBalance; public: void openAccount(int index); };
Code:void BankAccount::openAccount(int index) { int AccNum = 100100 + index; system("cls"); cout<< "********** Bank of Regis **********" << endl << endl; cout<< " New Account Number < " << AccNum << " > " << endl << endl; cout<< " Enter customers first name: " << endl; cout<< " ->: " ; cin>> CustFirst; cout<< " Enter customers last name: " << endl; cout<< " ->: " ; cin>> CustLast; cout<< " Enter customers PIN number: " << endl; cout<< " ->: " ; cin>> PinNum; cout<< " Enter inital deposite amount: " << endl; cout<< " ->: $"; cin>> AccBalance; CustAccNum = AccNum; system("cls"); cout<< "********** Bank of Regis **********" << endl << endl; cout<< " Account Summary " << endl; cout<< " Account# " << CustAccNum << endl; cout<< " Customer " << CustFirst << " " << CustLast << endl; cout<< " Balance $" << AccBalance << endl << endl; cout<< "***********************************" << endl; system("pause"); }



LinkBack URL
About LinkBacks



Want to add some