C - Pointers4

From EdWiki

Revision as of 09:30, 23 June 2015 by Jshankar (Talk | contribs) (1 revision imported: EdWiki -- Emsys pages from Shukra)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Pointers ...

  • Since pointers are variables, they can be used without de-referencing.
    For example, if ip and iq are pointers to integers, then iq = ip, copies the contents of ip into iq, thus making iq point to whatever ip pointed to.
  • Unary operators * and ++ associate right to left.
++*ip or (*ip)++; 	// increments what ip points
*ip++;           // increments the ip before de-referencing