首页 > 代码库 > 指针入门

指针入门

  • & produces the address of its operand.

    For example,the following statements an integer variable ‘a‘ and a pointer to an integer variable ‘p‘ are declared.Then the address of the variable a is determined with the & operator and is assigned to the pointer variable.

1 int a, *p;2 p = &a;
  • * is the indirection operator and is used with pointers to access the value being pointed to.