开发者

Array of pointers

I am trying to construct an m-way tree and I am having trouble visualizing an array of pointers pointing to different instances of the B_tree node class (this basically creates the array type nodes and includes all functions associated with the tree such as count, insert etc)

Are there any tips/tricks to visualizing an array of pointers for this case? Are there any good links/resources for explanation of array of pointer开发者_StackOverflow中文版s? (I did not find the common search results on google that helpful)...


Here is a picture of an array of pointers, they aren't pointing to anything, but this is a visualization of an array of pointers. Here is a link explaining arrays of pointers http://ee.hawaii.edu/~tep/EE160/Book/chap9/section2.1.4.html. Enjoy.

Array of pointers


Array with pointers is just like a usual array with a maximum number of size. Each position of the array it does not hold an integer or float or char or a struct. It holds a pointer. What a pointer is ? Imagine the computer's memory like a huge array which hold different kind of values. The variable which holds the pointer what it actually holds is the address of a block of memory. It does not hold the value of an integer but if you have int *a; , it means that the variable a which is store in a memory address hold the address of something which is integer.

The pointer always holds 4 bytes. Therefore an array with pointers means that each positions shows the memory address of something. If you have an integer array with pointers of size 10, means that each position shows the address of a memory block( this block stores an integer). So the array holds 10 pointers and each one of them shows to an integer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜