dimanche 1 janvier 2017

Increase allocated memory in C++

I have n points in x axis. At the start of the program I am allocating x with npoints. e.g. x = new double[npoints];

During the simulation npoints may vary. If npoints increases I want to increase the allocated memory. Also, if npoints decreases I want to delete that reduced memory.

Aucun commentaire:

Enregistrer un commentaire