C-pointer pointer

Source: Internet
Author: User

Overview:

The 77th program of the previous ' Classic C language programming 100 cases '

1#include <stdio.h>2 3 int4Mainvoid) {5     Char*s[]={"Mans","woman","Girl"," Boy","Sister"};6     Char**p;7     intK;8      for(k=0;k<5; k++) { 9p = &s[k];/*What statements are written here*/Tenprintf"%s\n",*p); One     } Aprintf"\ n"); -}

The variable s actually starts with the first character ' M ' in the first string (man) in the array, that is, the variable p and the variable s are pointers to pointers, and after understanding this, simply assign the first address of the one-dimensional array in each iteration to the variable p (each word in the main function, such as ' Man ', ' Woman ' equals a one-dimensional array):

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