Jump to content

Pointer arithmetic

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by David Martland (talk | contribs) at 20:57, 9 September 2003 (comment on programming etc - plus removal of NPOV (most ....)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Pointer Arithmetic is modifying the address pointed at by a pointer within a computer system. A common example of this is when copying a string to another, without using the C language's library funtion strCopy(), or when writing that function for a shared library. Some newer languages prohibit this, as it is a potential source of vile computer bugs. Java is one such language.

Many modern high level computer languages do not permit direct access to memory using addresses, so concepts of pointers and pointer arithmetic are not relevant. This is often deliberate, as many programming tasks do not require specific knowledge of where and how in computer memory data is stored.