Search results
Results from the WOW.Com Content Network
In its original form (as described by Niklaus Wirth), Pascal qualifies as a managed pointer language, some 30 years before either Java or C#. However, a Pascal amalgamated with C would lose that protection by definition. In general, the lower dependence on pointers for basic tasks makes it safer than C in practice.
Pointers also must have an associated type, and a pointer to one type is not compatible with a pointer to another type (e.g. a pointer to a char is not compatible with a pointer to an integer). This helps eliminate the type security issues inherent with other pointer implementations, particularly those used for PL/I or C .
Where "new" is the standard routine in Pascal for allocating memory for a pointer, and "hex" is presumably a routine to print the hexadecimal string describing the value of an integer. This would allow the display of the address of a pointer, something which is not normally permitted. (Pointers cannot be read or written, only assigned.)
It is also said that a pointer points to a datum [in memory] when the pointer's value is the datum's memory address. More generally, a pointer is a kind of reference, and it is said that a pointer references a datum stored somewhere in memory; to obtain that datum is to dereference the pointer. The feature that separates pointers from other ...
In languages with typed pointers like C, the increment operator steps the pointer to the next item of that type -- increasing the value of the pointer by the size of that type. When a pointer (of the right type) points to any item in an array, incrementing (or decrementing) makes the pointer point to the "next" (or "previous") item of that array.
Modern Object Pascal has yet another way to perform operations on simple types, close to boxing, called type helpers in FreePascal or record helpers in Delphi and FreePascal in Delphi mode. The dialects mentioned are Object Pascal compile-to-native languages, and so miss some of the features that C# and Java can implement.
Get AOL Mail for FREE! Manage your email like never before with travel, photo & document views. Personalize your inbox with themes & tabs. You've Got Mail!
when a and b are pointers C, C++: a == b *a == *b: when a and b are pointers C#: object.ReferenceEquals(a, b) a.Equals(b) The == operator defaults to ReferenceEquals, but can be overloaded to perform Equals instead. Common Lisp (eq a b) (equal a b) Erlang: a =:= b: a == b: when a and b are numbers Go: a == b: reflect.DeepEqual(*a, *b) when a ...