so this is what im trying to accomplish... when it creates the new account i would like for it to create a new instance name so that the information will be saved for that specific holder... as it is now i know the code will simply just overwrite the data. How do i go about this, and also reccomendations for books to buy to learn c++ I've used this sites tutorials and some videos on youtube thus far but would like to get something that goes more in depth...
thanks cj
Code:#include <iostream> using namespace std; class account{ int number;//acount number string holder;//account holder name int balance;//current balance public: account(){ number = 0; balance = 0; } int create(){ number++;//makes account number different for new holder cout<<"Please enter your name:"<<endl; cin>> holder; cin.ignore(); } }; int main(){ int choice; cout<<"1. Create account" <<endl; cout<<"2. Check Balance" <<endl; cout<<"3. Deposit Money" <<endl; cout<<"4. Take out money" <<endl; cout<<">> "; cin>> choice; cin.ignore(); account go; switch (choice){ case 1: go.create(); break; case 2: break; case 3: break; case 4: break; } }