Nope, code in the OP wasn't changed.
And I took a look today finally...
Yours works CarnageX. However...
All I changed from my original code was adding the
num = new double [max]; //initialize the space for the array!
line, which made it work perfect.