To add to what grumpy said, pay attention to these two lines
AntArmy is first declared to be a pointer to the Ant type.Code:Ant *AntArmy; AntArmy = new Ant[n];
Then AntArmy is assigned the the first element of a dynamically allocated array of Ant types.
The expression new Ant[n] allocates an array of Ant types and returns a pointer to the first element
AntArmy is assigned that pointer.
That would have been the same as simply writing:
Code:Ant* AntArmy = new Ant[n];