Article View: alt.comp.lang.learn.c-c++
Article #58Re: class help
From: Ron Natalie
Date: Tue, 01 May 2001 20:41
Date: Tue, 01 May 2001 20:41
22 lines
1977 bytes
1977 bytes
John Harrison wrote: > int num_of_accounts; > BankAccount the_accounts[100]; > > You see? The BankDB object holds (upto) 100 BankAccount objects. This is how > BankDb 'calls' an instance of BankAccount. E.g. No, BankDB holds exactly 100 BankAccount objects, not upto. If you want a dynamic number try: vector<BankAccount> the_accounts; > This approach has the limitation that you can only have a maximum of 100 > account in BankDB, there are various ways around that but at your level of > skill I'd stick with that for now. At his skill level, he should be learning to use the standard containers rather than screwing around with the suboptimal array type in C++. I recommend Koenig and Moo's Accelerated C++ as a text that teaches you the good habits first, rather than propagating C ugliness into C++.
Technical Details
Message-ID:
<3AEF1F74.C963F0B7@spamcop.net>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!mencken.net.nih.gov!not-for-mailReferences:
<9cms6r$emm$1@neptunium.btinternet.com> <S2FH6.13187$Kt2.1288005@news6-win.server.ntlworld.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114592,bcfa6c5c8a6717c0 X-Google-Attributes: gid114592,public X-Google-Thread: 10d4ba,bcfa6c5c8a6717c0 X-Google-Attributes: gid10d4ba,public X-Google-Thread: 109fba,bcfa6c5c8a6717c0 X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2001-05-01 13:39:49 PST Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!mencken.net.nih.gov!not-for-mail Message-ID: <3AEF1F74.C963F0B7@spamcop.net> From: Ron Natalie <ron@spamcop.net> Organization: Sensor Systems X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,comp.lang.c++ Subject: Re: class help References: <9cms6r$emm$1@neptunium.btinternet.com> <S2FH6.13187$Kt2.1288005@news6-win.server.ntlworld.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 22 Date: Tue, 01 May 2001 16:41:24 -0400 NNTP-Posting-Host: 156.40.240.200 X-Trace: mencken.net.nih.gov 988749589 156.40.240.200 (Tue, 01 May 2001 16:39:49 EDT) NNTP-Posting-Date: Tue, 01 May 2001 16:39:49 EDT