In Computer science,Pointers(Pointer) is an object in a programming language that uses an address whose value points directly (points to) the value of another place in the computer's memory. Because the desired variable unit can be found through the address, it can be said that the address points to the variable unit. Thus, visualizing the address is called a "pointer". It means that it can find the memory unit with its address.In high-level languages, pointers effectively replace the use of generic registers in low-level languages such as assembly language and machine code, but it may only apply to legitimate addresses. The pointer refers to an address in memory that can be taken out of the value stored in that address through an action called a counter-reference pointer. To make a metaphor, assume that the computer memory as a book, a content record a page number plus line number of the sticky note, can be regarded as a pointer to a specific page, according to the convenient paste surface page number and line number, turn to that page, the page that the line of text read out, It is the equivalent of a counter-reference to this pointer action. In information engineering, a pointer is a variable or array used to indicate the computer language of a memory address, or a register (register) in the central Processing unit (CPU) that corresponds to the memory address. Pointers generally appear in languages that are closer to the machine language, such as assembly language or C. Object-oriented languages such as Java generally avoid pointers. Pointers generally point to a function or a variable. When using a pointer, a program can either directly use the memory address stored in the pointer, or use the value of the function stored in the address. Using pointers to read data, in the context of repetitive operations, can significantly improve program performance, such as traversing strings, checking tables, controlling tables, and tree-like structures. It is faster to copy the pointer and then dereference the pointer to fetch the data, either in time or space, than directly copying and accessing the data itself. The mechanism of pointers is relatively simple, and its functions can be re-implemented into more abstract reference (reference) data shapes. Many programming languages support some form of pointers, the most notable being the C language, but some programming languages use a more restrictive approach to pointers,For example, Java generally avoids using pointers instead of references. There are two meanings, one being the data type and the other being the entity. The pointer acts as an entity and is a variable in a computer language that holds a memory address. Pointers generally appear in the lower-level programming languages, such as C language. High-level languages like Java generally avoid pointers, but rather references. Pointers as data types can be exported from a function type, an object type, or an incomplete type. The type of data exported from is calledreferenced type(referenced type). A pointer type describes an object whose value is a reference to an entity of the referenced type. The C + + standard stipulates that the "pointer" concept does not apply to member pointers (which do not contain pointers to static members). The C + + standard stipulates that pointers fall into two categories:
- Object pointer type: A pointer to void or an object type that represents the byte address of an object in memory or a null pointer.
- function pointer type: Refers to one of the functions
Pointers for understanding