Hi!
This code
Code:
int array[4000000]={0};
int main()
{
return 0;
}
compiled with 'g++ temp.cpp' produces a.out file 15Mb big, which is the amount of memory to be allocated.
Code:
#include <stdlib.h>
int main()
{
int *array=(int*)malloc(sizeof(int)*4000000);
return 0;
}
a.out is now 11K.
Anyone knows why this is so?
I'm using Red Hat 9, gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5).
Thanks in advance