void solve()
{
int *a = (int*)malloc(1000000000*sizeof(int));//case 1
cout<<1<<endl;
return;
}
So recently I was asked a question? Why this code compile and does not give RTE, it had to do something with virtual memory if you use a vector array instead it will provide bad_alloc as RTE. So what is the reason behind it or is it compiler dependent?
But the hint was to think about how virtual memory can be used here.