Q:

Is having a loop in C++ constructor a good Idea?

I was writing code for my homework. So as I finished one of my classes I ran into a question. Is having a loop to assign values to array a good idea?
This is my class. I was thinking of making either loop in the constructor or create a function which would assign values later, by calling it manually. 
Are these choices different? if yes, Which choice is better and why?
class Mule
{
    private:
        int numofMules;
        int MapSize;
        MuleNode* field;
        MuleNode* mules;
    public:
        void random_positions();
        void motion();
        void print_field();
        Mule(int nofMules, int mSize)
        {
            numofMules = nofMules;
            MapSize = mSize;
            mules = new MuleNode[numofMules];
            field = new MuleNode[MapSize*MapSize];
            for(i = 0; i < numofMules; i++)                              
            {
                mules[i].ID = i+1;
            }
            random_positions();
        }   
}

Edited the code because of the problem with allocation of one dimensional array at compilation time and recreated 2 dimensional array in 1 dimensional using formulas.
+---------------+-----------+-----------+  
| i = j * w + i | x = i % w | y = i / w |  w - width of the 2 dimentional array
+---------------+-----------+-----------+  

Conclusion: As the question was marked as opinion-based, I guess it means that there is no big difference in using loop in the constructor or creating a function which would assign values later.
If there are any facts or opinions about this question worth sharing, please comment or write your answer.

A:

There's not necessarily anything terrible about having a loop in a ctor.
At the same time, it's worth considering whether those items you're initializing couldn't/shouldn't be objects that know how to initialize themselves instead of creating uninitialized instances, then writing values into them.
As you've written it, the code doesn't really seem to make much sense though. The class name is Mule, but based on the ctor, it's really more like a collection of Mules. A Mule should be exactly that: one mule. A collection of N mules should be something like a std::vector<Mule>. A Mule that's really a collection of Mules is a poor idea.
You should also at least consider using std::vector instead of an array (assuming that you end up with a collection of items in the class at all, of course).

