Conquer C pointer

Source: Internet
Author: User

1. Local variables are usually released at the end of the block of statements where they reside. If you don't want to release a
Local variables, which can be declared by adding static to the local variable

The lifespan of three memory areas in 2.C.
Q The lifetime of a static variable begins when the program runs and ends when the program closes.
Q The lifetime of the automatic variable is until the end of the statement block that declares the variable.
Q The lifetime of the domain allocated by malloc () to call Free ().

3. A static variable is a variable that persists from the start of the program to the end of the run. Therefore, the static variable
The volume always occupies a fixed area on the virtual address space

4. The so-called "return address" refers to the ground that should be returned after the function has been processed
Access.

5. There is a get () function in the standard library, which can be read from the standard input as well as fgets ()
Takes one line of input, but unlike fgets (), you can't pass the buffer size to it.

6. The value "0x12345678" is often "12,
34, 56, 78 "in the order of storage, this configuration is called the big-endian (Big-endian) byte sequence.

7.5. void func (int hoge[3][2]) and void func (int hoge[][2]); with the void func (int (*hoge[2])) Declaration as

8.6. Char str[256] Output with printf (str); In Stdio.h's prototype, the first parameter of printf () is defined as "point to char pointer"

9.7.const the type is decorated as read-only how to use Const a) refers to the function B for the input) refers to the function of the output C) refers to the function used for input and output

10.Typedef is used to define aliases for a type

11. int a[] and int *a have the same meaning only in the case of declaring a function parameter

12. Use goto in exception handling to make the program more uncluttered

Conquer C 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.