Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Pointer (computer programming)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Pascal=== Unlike many languages that feature pointers, standard [[International Organization for Standardization|ISO]] [[Pascal (programming language)|Pascal]] only allows pointers to reference dynamically created variables that are anonymous and does not allow them to reference standard static or local variables.<ref>ISO 7185 Pascal Standard (unofficial copy), section [http://standardpascal.org/iso7185.html#6.4.4%20Pointer-types 6.4.4 Pointer-types] {{Webarchive|url=https://web.archive.org/web/20170424183023/http://www.standardpascal.org/iso7185.html#6.4.4%20Pointer-types |date=2017-04-24}} and subsequent.</ref> It does not have pointer arithmetic. 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 (Programming Language)|C]]. It also removes some risks caused by [[dangling pointers]], but the ability to dynamically let go of referenced space by using the <code>dispose</code> standard procedure (which has the same effect as the <code>free</code> library function found in [[C (Programming Language)|C]]) means that the risk of dangling pointers has not been entirely eliminated.<ref>J. Welsh, W. J. Sneeringer, and C. A. R. Hoare, "Ambiguities and Insecurities in Pascal," ''Software: Practice and Experience 7'', pp. 685β696 (1977)</ref> However, in some commercial and open source Pascal (or derivatives) compiler implementations βlike [[Free Pascal]],<ref>Free Pascal Language Reference guide, section [http://www.freepascal.org/docs-html/ref/refse15.html#x43-490003.4 3.4 Pointers]</ref> [[Turbo Pascal]] or the [[Object Pascal]] in [[Embarcadero Delphi]]β a pointer is allowed to reference standard static or local variables and can be cast from one pointer type to another. Moreover, pointer arithmetic is unrestricted: adding or subtracting from a pointer moves it by that number of bytes in either direction, but using the <code>Inc</code> or <code>Dec</code> standard procedures with it moves the pointer by the size of the [[data type]] it is ''declared'' to point to. An untyped pointer is also provided under the name <code>Pointer</code>, which is compatible with other pointer types.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)