Function of double pointer in C ++ (INT **)

Source: Internet
Author: User

For ease of description, all the following pointer types are int *, int **

Simple pointer example:

Int A = 10;

Int * P = & A; // The most commonly used pointer. It is a level-1 pointer and its value is the address where the memory stores variable.

Int ** pp = & P; // double pointer. Its value is the memory address of P.

-------------------------------------------------

Prerequisites:

When using pointers, all people must establish a concept in advance: pointers are a data type, which is similar to int bool Char. int
It stores integer data, char characters, and pointers in memory segments. Int Is Used for integer declaration, int * is used for pointer type declaration, and INT is used for double pointer declaration.
** The int type in the pointer refers to the memory type. Which variable the Pointer Points to is actually the memory address of the variable.

So do you think it's the same? It is very easy to understand this and everyone will be using pointers.

At present, almost all documents are explained in an independent chapter, which is an important reason for readers to misunderstand pointers.

 

Related Article

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.