I don't understand the 2nd argument. Whats is it exactly? And most importantly he(the programmer) uses it to create a new array of Object objects , of num (the variable) size at the end.
void expand(const Object &s, Object* &children, int &num)
{
...
children = new Object[num]; // <----
}