So if you just took all the above code and change that one line:
1. All the loops will be wrong (and could cause crashes)
2. Delete [] is wrong when you haven't created a new array.
** You get the output when you change to new int* - but you are causing heap corruption/access violation**