Used on demand to allocate a block of data for use by the program.Slower to allocate in comparison to variables on the stack.The data is freed with delete, delete, or free. In C++, variables on the heap must be destroyed manually and never fall out of scope.Stored in computer RAM just like the stack.Usually has a maximum size already determined when your program starts.You would use the stack if you know exactly how much data you need to allocate before compile time and it is not too big. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |