0
What's the point of requesting the memory if you're just going to free it up?
3 ответов
+ 6
What's the point of ingesting food if you're just going to defecate?
The point of dynamically requesting memory would of course be to use it to store data which size is known only at run time, in which after your program has executed, you free the memory because you no longer need it (and because programmers are responsible for garbage collection in C++).
0
Simply put - You need 100 chairs for a wedding. Are you gonna buy 100 chairs or gonna hire a decorator for a day? Of course you don't need all those chairs after the wedding.
So requesting memory is like hiring decorator when you need. It helps you to spend less money( in this case memory) and still get the job done.
Have a good day sir.😃
0
thanks, helpful explanation