Help with class declarations

Hi this is my first time working with classes/methods/constructors for my beginners C++ class. I just had a quick question. For my assignment I just created a class called Account, and I have it working just fine. Now I have to create another class (AccountDB). For the declaration for this class my instructions say that AccountDB should have two private data members:

- An array of 30 account objects.
-An integer that specifies the number of accounts actually stored in the array.

Just wondering how would I declare the array of account objects in the header file for the new class I am creating.
For the integer it would just be:
int numAccounts i think?

Any help would be greatly appreciated, cpp noob here! Thanks!!
Last edited on
Do you know how to declare an array of integers?
Yeah I know how to declare an array of integers, I just wasn't sure what to do for this because its an array of account objects. Would it be like account name[30] or something?
Yep, account name[30] should work fine.

If you need a separate integer to keep track of them, it would be something like this.

1
2
3
int Accounts = 30;

account name[Accounts];
Topic archived. No new replies allowed.