Notes -------- pointer

Source: Internet
Author: User
// # Include <stdio. h> int main () {int * P, I = 2; // int * must be of the same Integer type P = & I; Int J, * g = & J; // The pointer is a variable whose value is the memory address./* The declared int * is a pointer type, the address of an integer variable, and the number of the memory unit; 1 first p saves the address of I p points to I; 2. P is not I, I is not P. Changing P does not change I, and modifying I does not change P. It is two different variables. 3. if a pointer variable points to a common variable, * the pointer variable is equivalent to a common variable. 4.*5. the address is the number of the memory unit. The mutual change between I and P will not change the value of the other party. Unless it is added */*, it indicates that the complex data structure is used to quickly transmit data. Instead, the function returns more than one value directly. easy to process strings with access to memory is the basis for understanding object-oriented references * // * pointer Classification 1 Basic Type pointer 2 pointer and array 3 pointer and function 4 pointer and struct 5 Multi-level pointer * // * three lines of CPU processing memory control data address line-> C-> internal * // * 32-bit 32-bit address bus 2 32-power byte address number 0 = 4g-1; subtraction in only four arithmetic operations with pointers */}
# Include <stdio. h> int main () {int I = 5;/* int I; Define I = 5; initialize */int * P; int * q; P = & I; /** q = p */syntax error/* int * is different from int type */** q = * p */Q unallocated memory address/* P = Q; */Q is a spam value/** q = * p */Wood allocated address}


Notes -------- pointer

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.