I' am learning c++ and executing this code
#include<stdio>
using namespace std;
int main(){
char* buffer = new char[5];
printf("%p", &buffer); // 000000000061fe10
cout<<endl;
printf("%p", buffer); // 0000000000796b700
}
gives me 2 memory locations that are totally separated i mean around 1.5 million bytes away so why is this the heap size is supposed to be 5 bytes right ? char size * 5. Heap grows down (from 0xFFF... to 0x0000..) under heap there is the stack so difference is supposed to be much more less so what is memory layout in this case. and what is that that I don't understand exactly in my explanation above