- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Hi all, If I want to check if memory has already been alocated to a pointer, and if it has I wnat ot delete it, is this how it would work? theGraph = new MyObject[size()]; if (theGraph != 0){ // or even NULL delete[] theGraph; } This seems intuitive to … |
|
If a 2d array is allocated memory in this fashion, how should it be deleted? MyObject **lastJobs, **lastMachines ; lastJobs = new MyObject*[getNbJobs()] ; lastMachines = new MyObject*[getGreatestMachineNb()] ; does this suffice: delete[] lastJobs; delete[] lastMachines; |
|
I have a problem which is outlined below. I get an unhelpful memory dump. I have 2 questions. Why doesn't the memory dump contain the line number as it should. And why am I geting memory dumps without ever using new or malloc or any such functions. This is being … |