iOS Learning Notes---C language eighth day

Source: Internet
Author: User

Pointer

First, the address of the variable A is stored in another variable, such as in the variable B, and then indirectly by the variable B to reference the variable A, indirectly read and write the value of the variable A. Variables that are used to store variable addresses are called "pointer variables"

int *p=null; Initial value: null constant equals 0 variable type: integer pointer int *

The number of bytes in the pointer variable is only relevant to the operating system

Pointer type conversion%p

printf ("p =%p\n", p);

    // C language when defining pointers, like to use p,q,r and so on.     int *p = NULL;     // The pointers we usually refer to are pointer variables     // variable that holds the memory address (memory number) when the pointer variable.     printf ("%p", p);

Fetch Address Characters &

int a = 3; int *p = &a;

Value operator *

    int 3 ;     int *p = &A;    printf ("%d\n", *p);     Char ' D ' ;     char *q = &C;    printf ("%c\n", *q);

The pointer's assignment represents the pointer's heavy direction.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.