Pages

Thursday, 1 October 2020

Chapter 17 // Exercise 9 - Principles & Practice Using C++

In this exercise I am using Visual Studio 2017 and the std_lib_facilities header provided by Stroustrup.

Chapter 17 // Exercise 9

Which way does the stack grow: up (toward higher addresses) or down ( towards lower addresses)? Which way does the free store initially grow (that is, before you use delete)? Write a program to determine the answers.

Github: https://github.com/l-paz91/principles-practice/blob/master/Chapter%2017/Exercise%209

If you're newing via a for loop it seems to pick addresses near to each other? Interestingly, it appears to grow downwards for numbers and upwards for chars. I don't think it's set in stone though as I've seen the free store ints going upwards.

No comments:

Post a Comment