"C Language Learning" 02__auto,static,register Analysis __c language

Source: Internet
Author: User
Variables in the C language can have their own properties
You can add the "Properties" keyword when you define a variable

The "Properties" keyword indicates the unique meaning of a variable

1:auto

Auto is the default property of local variables in C language
The compiler defaults to all local variables are auto

2:static

The static keyword indicates the variable's "statically" property
Static key has the meaning of "scoped qualifier" at the same time

Static decorated local variables stored in the program static area
Another meaning of static is the file scope identifier

3:register

The Register keyword indicates that the variable is stored in a register
Register is only a request register variable, but it does not necessarily require success

The register variable must be a value that the CPU register can accept
Cannot get address of register variable with & operator

Summary
The auto variable is stored in the program's stack, and the default property
Static variable stored in program static area
Register variable request stored in CPU register

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.