![[Dept of Engineering]](http://www.eng.cam.ac.uk/images/house_style/engban-s.gif)
The new command creates space ``on the fly''. new[] creates arrays. There are corresponding delete and delete[] calls.
int i; cout <<"Type an integer "; cin >> i; int *ia = new int[i];creates an integer array of the required size that can be destroyed by
delete[] ia;
If there's not enough memory for new to provide what
you want, it will cause a bad_alloc exception (see
section 10 for details).