IT SOLUTIONS
Your full service technology partner! 
+Expand
   ► KBTo/From GuidesPHP  Print This     

Pointers (PHP and Delphi Prism Cross Reference Guide)

By Mike Prestwood

PHP versus Delphi Prism: A side by side comparison between PHP and Delphi Prism.

 
Data Structures
 

Data structures allow you to store and work with data. Common data structures include arrays, associative arrays, etc.

Pointers

[Other Languages] 

General Info: Pointers / References

A pointer is a variable type that allows you to refer indirectly to another object. Instead of holding data, a pointer holds the address to data -- the address of another variable or object. You can change the address value a pointer points to thus changing the variable or object the pointer is pointing to.

A reference is a type of pointer that cannot change and it must always point to a valid storage (no nulls).

PHP:   Not Supported

PHP supports references which allow you to refer to the value of a variable but PHP does not support true developer defined pointers. You cannot get and use the address of a variable.

However, you can still do inexpensive assignments by assigning by reference.

Delphi Prism: 

Although pointer data types in Prism coding are less important than in other languages such as C++, Prism does support developer defined pointers. Use the ^ operator to declare a pointer data type. Use the @ operator to return the current address of a variable.

In .Net managed coding the use of pointers is not safe because the garbage collector may move memory around. To safely use pointers, use the unsafe keyword. However, avoid unsafe code if possible.

More Info / Comment












Sales Website: www.prestwood.com Or visit our legacy sales site: 
legacy.prestwood.com


©1995-2025 Prestwood IT Solutions.   [Security & Privacy]