13.1 User Defined Types (UDTs)


13.1 User Defined Types Files

The textbooks explain this topic in sufficient detail, so this page exists to add further to the information already there

Pointers

A pointer is a variable that stores a memory address. That is, instead of storing the data, the pointer stores the address of the data.

Pointers are used to store the addresses of other variables or memory items. Pointers are very useful for another type of parameter passing, usually referred to as Pass By Address (think about ByRef when passing in parameters). Pointers are essential for dynamic memory allocation and behind the scenes, all languages use pointers when you create a variable. Remember, pointers are referenced as a data type (composite or non-composite type), because the language needs to know how many bytes of memory to read when dereferencing the pointer. We use @ to reference a pointer.

Once a pointer is declared, you can refer to the thing it points to, known as the target of the pointer, by "dereferencing the pointer". To do this, use the ^ (circumflex) operator.

Languages such as Python and VB.NET do not support pointers, as memory is tightly managed.

More on pointers

Pseudo-Pointers in VB

Pointers in Pascal

Sets

VB HashSet

VB SortedSet

Records (structures)

Structures are covered on page 60 in the VB.NET companion Booklet

VB Structures and Objects

VB Structures


Pseudo-Pointers in VB

Pointers in Pascal

Sets

VB HashSet

VB SortedSet

Records (structures)

Structures are covered on page 60 in the VB.NET companion Booklet

VB Structures and Objects

VB Structures