What is the role and purpose of the second-level pointer ?. XML

Source: Internet
Author: User
Pre {Line-Height: 1; color: #9f1d66; Background-color: # e1e1e1; font-size: 16px ;}. sysfunc {color: # 5d57ff; font-style: italic; font-weight: bold ;}. selffuc {color: #8e0ed3 ;}. bool {color: #008000 ;}. condition {color: #008000; font-weight: bold ;}. key {color: #440080 ;}. vaR {color: #008000; font-style: italic ;}. digit {color: #000080; font-weight: bold ;}. includepre {color: # 661d9f ;}. operator? {Color: # fd1a53; font-weight: bold ;}

???? The second-level pointer ** P is defined not to use ** P to represent the point value, but to use * P to store the address of the unit storing the value .?????

 

???? Void? Getmemory2 (Char? ** P ,? Int? Num )?????? {?????????? * P? =? (Char? *) Malloc (Num );??????}?????? Void? Test (void )?????? {??????????? Char? * Str? =? NULL ;??????????? Getmemory (& STR ,? 100 );??????????? Strcpy (STR ,? "Hello ");?????????????? Printf (STR );??????????????? Free? STR ;??????}???????? When parameters are passed at the beginning, the Unit Address of STR is assigned to P ,?? In this way, the Unit Storage in P is the STR address ,?? Thus, * P? Represents the STR value.

Used in this article? Calligraphy and painting novel software? Released, the content has nothing to do with the software, and the painting and calligraphy novel software? More comfortable reading, more comfortable writing, and easier Publishing.

What is the role and purpose of the second-level pointer ?. XML

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.