--- glogic_1 <[EMAIL PROTECTED]> wrote: > --- In [email protected], "glogic_1" > <[EMAIL PROTECTED]> wrote: > > > > Hey all > > I dont have the code for the following as i no > where know enough > about > > programming yet but here goes my question anyway. > > using classes i can create stuff like the > following > > class account{ > > int accnum; > > char acctype; > > int balance; > > etc > > public: > > int getbalance(void); > > etc > > }; > > now i save classes such as this as a .h file > > so to create each new account i would do this in > main cpp > > account Gavin; > > this would create a variable called gavin of type > account right? > > but how would i create accounts within the program > as its running > > without knowing before hand the account(in this > case Gavin) name ? > > or how would this be approached? > > hope this makes sense > > g > > > > would making a dynamic array of class account be the > right way to > handle this? > > > a dynamic array would work. Are you planning on saving the data to a file? If so you might not need the array but a pointer to the current record.
Mickey M. Construction Partner Inc. http://www.constructionpartner.com ____________________________________________________________________________________ Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091
