第11章 动态内存分配
1.在你的系统中,你能够声明的静态数组最大长度能达到多少?使用动态内存分配,你最大能够获取的内存块有多大?
英文答案原文:
This will vary from system to system.There are several things that may affect the result on PC-based systems, includeing the memory model in use, the amount of space in the data and/or stack segment, the amount of available memory on the system, and so forth. The result on Unix systems will depend on the amount of available swap space, among other things.
答案中文翻译:
根据系统不同而值不同。以下是影响基于PC系统的因素:使用的内存模式、数据段或栈段的空闲量、系统上可用内存量等。Unix系统上,取决于可用的交换空间大小。
2.当你一次请求分配500个字节的内存时,实际上获得的动态分配的内存数量总共有多大?当你一次请求分配5000个字节时又如何?它们存在区别吗?如果有,你如何解释?
英文答案原文:
There are two explanations possible.Requesting smaller chunks may allow more memory to be allocated because the amount of memory left over after the last alloc