Pointer

Share

What is a Pointer in the Computer?

The term pointer may refer to two things:

1: the mouse cursor, which points to elements on the screen.

2: a piece of data in a memory address that holds the memory address of another piece of data, e.g. in the code int* p = 2, the pointer p points to an integer stored in the memory address 0x00000002 in a CPU with 32-bit addresses.

A diagram showing the relationship between three components: hard links, inode, and disk. The hard links /foo and /bar are associated with the number 42 (this is the data in a directory block). The inode has properties such as being the number 42, having the owner 2, the group 2, having 2 hard links, the permission rwxrw-r--, and multiple pointers to blocks, namely, 1, 2, 12, 25, and 15, following by 5 pointers set to 0. The disk component has blocks (e.g. 4096 bytes each) that are pointed to by arrows according to the numbers in the inode component. The blocks 1, 2, 12, and 24 are coloed orange. The last block pointed, 15, is colored partially orange.
A diagram showing the relationship between hard links, inodes, and disk blocks on Linux. [How Hard Links and Inodes Work on Linux]
A diagram showing the relationship of the vptr of instances to the vtables of subclasses and superclasses. Each instance has a vptr pointer alongside its other fields. The vptr of a given instance points to a vtable of a class, be it a subclass or superclass. The superclass contains pointers to functions. The values of these pointers can be inherited from the superclass to the subclass. Only virtual methods are included in the vtable, non-virtual methods are not.
A diagram showing the relationship between the vptr of instances and the vtable of classes on some Object Oriented Programming implementations, such as C++ [How Abstractions Work in Programming].
Written by Noel Santos.

About the Author

I'm a self-taught Brazilian programmer graduated in IT from a FATEC. In a world of increasingly complex and essential computers, I decided to use my technical expertise in hardware, desktop applications, and web technologies to create an informative resource to make PC's easier to understand.

View Comments