System.Pointer

From RAD Studio API Documentation
Revision as of 15:58, 16 October 2011 by TestAccount (Talk | contribs)

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 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. Usually it is 4 bytes.

See also

Personal tools
Translations