Posted on 19th October 2009No Responses
Pointer Assignment- Definition and Example

Pointer Assignments
As with any variable, you may use a pointer on the right-hand side of an assignment statement to assign its value to another pointer. For example,
#include
int main(void)
{
int x;
int *p1, *p2;
p1 = &x;
p2 = p1;
printf(” %p”, p2); /* print the address of x, not x’s value! */
return 0;
}
Both p1 and p2 now point to x. The address of x is displayed by using the %p printf() format specifier, which causes printf() to display an address in the format used by the host computer.

Popularity: 1% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BarraPunto
  • Bitacoras.com
  • BlinkList
  • blogmarks
  • BlogMemes Fr
  • BlogMemes Sp
  • Blogosphere News
  • blogtercimlap
  • co.mments
  • connotea
  • Current
  • Design Float
  • Diigo
  • DotNetKicks
  • DZone
  • eKudos
  • email
Comments
Leave a Response