我搞乱了malloc调用,我想知道我的操作系统能给你多少内存.我试过了:
int main() {
char *String = 0;
String = malloc (100000000000000); // This is 10^14
if (String)
printf ("Alloc success !\n");
else
printf ("Alloc failed !\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
而且......它奏效了.10 ^ 14大约是18太字节.笔记本电脑是否有可能拥有如此多的内存?如果那不可能,怎么解释呢?