Index: > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Business Industries Finance Tax

Home > Pointer


First Prev [ 1 2 3 ] Next Last

: This article is about the computer data type. For other meanings of pointer, see pointer (disambiguation).

In computer science, a pointer is a programming language datatype whose value is used to refer to ("points to") another value stored elsewhere in the computer memory. Obtaining the value that a pointer refers to is called dereferencing the pointer. A pointer is a simple implementation of the general reference datatype, although it is quite different from the facility referred to as a reference in C++.

1 Architectural roots

Pointers are a very thin abstraction on top of the addressing capabilities provided by most modern architectures. In the simplest scheme, an address, or a numeric index, is assigned to each unit of memory in the system, where the unit is typically either a byte or a word, effectively transforming all of memory into a very large array. Then, if we have an address, the system provides an operation to retrieve the value stored in the memory unit at that address. Pointers are datatypes which hold addresses. See reference (computer science).

In the usual case, a pointer is large enough to hold more different addresses than there are units of memory in the system. This introduces the possibility that a program may attempt to access an address which corresponds to no unit of memory, called a segmentation fault. On the other hand, some systems have more units of memory than there are addresses. In this case, a more complex scheme such as segmentation or pagingAlternate meanings: See paging (telecommunications). Bank switching is also sometimes referred to as paging. In computer operating systems, paging memory allocation algorithms divide computer memory into small partitions, and allocates memory using a page is employed to use different parts of the memory at different times.

In order to provide a consistent interface, some architectures provide memory-mapped I/OMemory-mapped I/O MMIO and port I/O (also called port-mapped I/O or PMIO are two complementary methods of performing input/output between the CPU and I/O devices in a computer. Memory-mapped I/O uses the same bus to address both memory and I/O devices, an, which allows some addresses to refer to units of memory while others refer to device register s of other devices in the computer. There are analogous concepts such as file offsets, array indices, and remote object references that serve some of the same purposes as addresses for other types of objects.

2 Uses

Pointers, which are directly supported without restrictions in CThe C Programming Language Brian Kernighan and Dennis Ritchie, the original edition that served for many years as an informal specification of the language The C programming language is a low-level standardized programming language developed in the early, C++, and most assembly languageAssembly language or simply assembly is a human-readable notation for the machine language that a specific computer architecture uses. Machine language, a pattern of bits encoding machine operations, is made readable by replacing the raw values with symbos, are primarily used for constructing referenceA reference is something that refers or points to something else, or acts as a connection or a link between two things. The objects it links may be concrete, such as books or locations, or abstract, such as data, thoughts, or memories. In semantics, refers, which in turn are fundamental in constructing nearly all data structurebinary tree, a simple type of branching linked data structure. In computer science, a data structure is a way of storing data in a computer so that it can be used efficiently. Often a carefully chosen data structure will allow a more efficient algorithm ts, as well as in passing data between different parts of a program.

When dealing with arrays, the critical lookup operation typically involves a stage called address calculation which involves constructing a pointer to the desired data element in the array. In other data structures, such as linked lists, pointers are used as references to explicitly tie one piece of the structure to another.





Non User