Array pointers and array of pointers

Source: Internet
Author: User

1 //numeric pointers and array of pointers2 //C language Environment3 4#include"stdafx.h"5 6 intMainintargcChar*argv[])7 {8     //An array pointer, which is a pointer. This pointer points to an array.9     //An array of pointers, which is an array. The elements stored in this array are pointers.Ten     //What do you think? One     //To see who has the highest priority, the priority is the focus. A  -     CharP[] ={'A','B','C','D'} ; -     //This is an array of characters called p, and this array has 4 char-shaped elements. the  -     Char* pchar[] = {"First Grade","2 grade","3 Grade","4 Grade"} ; -     //because [] the priority is higher than *, the focus is [], that is, the array. -     //so this is an array, the name of the array called Pchar. +     //The array contains 4 elements, these 4 elements are pointers (char*), according to the contents of the pointer as the address of the found is a char type. -     //The description is a string, and the string is interpreted as an address. +     //because in the Assembly statement, the character is put into some memory, and then use the memory address to assign to other variables. A  at     CharB[] = {'A','B','C'}; -     //This is a character array named B, which has 3 char-shaped elements. -  -     Char(*cha) [3] = {&p}; -     //because () the priority is higher than [], the () inside of a *, the focus is () inside the *, that is, the pointer. -     //so this is a pointer, the type of pointer is char (*) [3], and this pointer is named CHA in     //this pointer content is the first address of an array, which must have 3 char elements. -  to     return 0; +}

Array pointers and array of pointers

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.