How array and pointer parameters are modified by the compiler

Source: Internet
Author: User

Transfer from http://blog.csdn.net/todd911/article/details/8831963

Formal parameters that are matched by arguments

Array of array char c[8][10];     (with stride length, 10char) char (*) [10];        Array pointer pointer array char *C[15]; (no stride) char **c; Pointer to pointer array pointer (ROW) char (*C) [64]; (with stride length, 64char) char (*C) [64]; Pointer char **c without changing the pointer;        (no step) char **c; Do not change the reason why you can see char **argv in the main () function because argv is an array of pointers (char *argv[]), which is rewritten by the compiler as a pointer to the first element of the array, which is a pointer to the pointer, If the argv parameter is actually declared an array of arrays (that is, Char argv[10][15]), it is rewritten by the compiler to char (*ARGV) [15] instead of char * * argv. It is summarized as follows: If the array that the pointer points to has a step size, it cannot be converted to a pointer pointer.

How array and pointer parameters are modified by the compiler

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.