The answer is machine (CPU type) and operating system related

old (HH)
The answer is machine (CPU type) and operating system related. For DOS (of course Intel CPU), you can directly assign the absolute address of the block of memory to the memory pointer. For a near pointer, just offset need to be assigned. For a far pointer, both offset and segment. However you should code to protect the block of memory allocated in this way.
(#46076@0)
2001-4-15 -05:00

回到话题: 请问用C如何动态分配一个数组,其内存首地址由参数制定。我是象汇编那样用指针直接访问内存。有相关的函数可以调用么? malloc, calloc 好象不能指定地址。

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=46076