挑战malloc极限,看看你的系统有多大的内存分配能力
/**: MallocLimit.c
* by lonelyforest
*这个程序在DOS下运行,将会输出您的内存到底能够
*分配多大!!!
*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
int MB = 0;
while ( malloc(1<<20) ) ++MB;
printf("/n has %d MB memory!/n", MB);
return 0;
}
* by lonelyforest
*这个程序在DOS下运行,将会输出您的内存到底能够
*分配多大!!!
*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
int MB = 0;
while ( malloc(1<<20) ) ++MB;
printf("/n has %d MB memory!/n", MB);
return 0;
}
 
                    
                     
                    
                 
                    
                 
                
            
         
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号