Hi friends,
I know this is such a freak code, but out of curiosity I did it to see memory usage increase using new operator.
int main()
{
char* a;
for (;;)
{
//cout<<&a<<endl;
a = new char[10];
}
}
As you see line7 is commented. When i run this program, obviously a linear increase in memory usage. I could verify it from windows task manager.
But if I uncomment the line7, I could see in the console that same address is getting printed, which means that I don't see any increase in memory. Why is that?