System.Pointer

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

type Pointer = ^Pointer;

C++

typedef void*                Pointer;          //

Properties

Type Visibility Source Unit Parent
pointer
typedef
public
System.pas
sysmac.h
System System

Description

Address of a byte in memory.

A void pointer represents the address of a byte in memory. Such a pointer cannot be dereferenced, because no type information is associated with it. However, a void pointer can be cast to a typed pointer and then dereferenced.

Variables declared with the specifier register are not located in the main address space and cannot be referenced.

Depending on the pointer value, dereference operation can have various effects:

Pointer value Dereference effect
address of data Produces the data value.
address of function/procedure Generates a call to a function/procedure.
nil/NULL Generates an error or exception. See EAccessViolation.
invalid Undefined result. Indicates a software fault. See EInvalidPointer.

Pointer reference/dereference operators:

Delphi C++
Reference @object &object
Dereference object_pointer^ *object_pointer

The size of a pointer depends on the operating system and/or the processor. On 32-bit platforms, a pointer is stored on 4 bytes as a 32-bit address. On 64-bit platforms, a pointer is stored on 8 bytes as a 64-bit address.

See Also