Step 3 Runtime Views: C++ has backend compatibility of
supporting C functions, like malloc(), calloc() or realloc()
function to manipulate memories at a lower level.
a) Reallocation of memory : The size of the input was fixed to
100 bytes/characters, with realloc() function, and most of it
remained used. The function, ralloc(), was used to adjust to it's
required length than the size you started with. In this case
you entered 36 bytes/characters copied to the
Please note the allocated size before
(100 bytes) and after (36 bytes)in the display as shown below.
b) Without reallocating memory: memory size will remain
As we chose not to reallocate the memory block (100 bytes), the
size will remain same as declared and initiated.