Skip to main content

All Questions

Filter by
Sorted by
Tagged with
-1 votes
1 answer
165 views

Partially deallocating structs/classes in C++

Is there a way to partially deallocate structs/classes in C++? I was trying to build some sort of a new pointer in C++ that point to RefCount template<typename T> struct RefCount { unsigned ...
Ak2399's user avatar
  • 837
1 vote
5 answers
1k views

Problem in Deleting the elements of an array allocated with new[]

This question is similar to Problem with delete[], how to partially delete the memory? I understand that deleting an array after incrementing its pointer is not possible as it loses the track of how ...
Mohit's user avatar
  • 2,110
0 votes
3 answers
2k views

Is it practical to delete all heap-allocated memory after you have finished using it?

Are there any specific situations in which it would not be practical nor necessary to delete the heap-allocated memory when you are done using it? Or does not deleting it always affect programs to a ...
Andy N.'s user avatar
  • 67
2 votes
0 answers
89 views

How to force dynamically allocated classes to have their members allocate on the heap as well? [duplicate]

Currently working on cross-platform allocation, where I am given a system, which has a very limited "stack" as an automatic scope for variables. However, said stack is still commonly used and filling ...
Nikita's user avatar
  • 649