Hi all, today a question arised inside my mind:
If I have a cycle like this:
What happens?Classe *a;
while( ... ){
a = new Classe();
}
Will I continue on allocating new instances of Classe on the heap or the same part of memory is used at each allocation?
Briefly,I mean for example, if I use an infinite cycle, will I run out of memory or not?
The correct way would be
true?Classe *a;
while( ... ){
a = new Classe();
delete a;
a = 0;//Optional
}
Thanks,
Simone
Bookmarks