C++ Array Member of Constant Length (Initialisation of)
<p>I have a class that contains an array. I want this array to be set at the length of a constant:</p>

<pre><code>// Entities.h
    class Entities
    {
        private:
         const int maxLimit;
         int objects[maxLimit];
         int currentUsage;

        public:
         Entities();

         bool addObject(int identifier);
         void showStructure();
    };
</code></pre>

<p>The main problem I'm having is with the constructor. I thought:</p>

<pre><code>// Entities.cpp
    Entities::Entities() : maxLimit(50)
    {
        currentUsage = 0;
        cout &lt;&lt; "Entities constructed with max of 50" &lt;&lt; endl;
    }
</code></pre>

<p>would have been sufficient...but not so. I don't know if I can use the initialiser list for array initialisation.</p>

<p>How can I initialise the 'objects' array using the 'maxLimit' const? I'm relatively new to classes in C++ but I have experience with Java. I'm mainly testing out this phenomenon of 'constness'.</p>

<p>Cheers.</p>
