文件名称:array to pointer
介绍说明--下载内容均来自于网络,请自行研究使用
Let’s say that you need to store 100 integers so that they’re easily accessible. However,
let’s further assume that there’s a problem: The memory in your computer is so fragmented
that the largest array that you can use holds only 10 integers. (Such problems
actually arise, although usually with larger memory objects.) You can solve this problem
by defining 10 separate int arrays of 10 integers each, and an array of 10 pointers to
these arrays. The int arrays can have names like a0, a1, a2, and so on. The address of
each of these arrays can be stored in the pointer array of type int*, which can have a
name like ap (for array of pointers). You can then access individual integers using
expressions like ap[j][k], where j steps through the pointers in ap and k steps through
individual integers in each array. This looks as if you’re accessing a two-dimensional
array, but it’s really a group of one-dimensional arrays.
Fill such a group of arrays with test data (say the numbers 0, 10, 20, and so on up to
990).
let’s further assume that there’s a problem: The memory in your computer is so fragmented
that the largest array that you can use holds only 10 integers. (Such problems
actually arise, although usually with larger memory objects.) You can solve this problem
by defining 10 separate int arrays of 10 integers each, and an array of 10 pointers to
these arrays. The int arrays can have names like a0, a1, a2, and so on. The address of
each of these arrays can be stored in the pointer array of type int*, which can have a
name like ap (for array of pointers). You can then access individual integers using
expressions like ap[j][k], where j steps through the pointers in ap and k steps through
individual integers in each array. This looks as if you’re accessing a two-dimensional
array, but it’s really a group of one-dimensional arrays.
Fill such a group of arrays with test data (say the numbers 0, 10, 20, and so on up to
990).
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : array to pointer.txt 列表