visual studio - About Memory Management When mentioning C++ -


when mention memory management c++ capable of doing, how can see thing? done in theory guessing?
took logical design intro course , covered systems of numbers , boolean algebra , combinational logic,will help?
in visual studio , there kind of tool visualize memory,i hope im not being ridiculous here ?


thank you.

c++ has variety of memory areas:

  • space used global , static variables, pre-allocated compiler
  • "stack" memory that's used preserving caller context during function calls, passing function arguments (others may fit in cpu registers), , local variables
  • "heap" memory that's allocated using new or new[](c++'s preferred approach) or malloc (a lower-level function inherited c), , released delete, delete[] or free respectively.

the heap important in supports run-time requests arbitrary amounts of memory, , usage persists until delete or free explicitly used, rather being tied lifetime of particular function calls per stack memory.

i'm not aware of useful tools visualising , categorising overall memory usage of running c++ program, less still relating pointers in source code have how memory associated them. general guideline, it's encouraged write code in such way pointers introduced when program ready point them @ something, , go out of scope when no longer pointer @ something. when that's impractical, can useful set them null (0), if you're monitoring executing program in debugger can tell pointer isn't meant point legitimate data @ point.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -