First Understanding C pointer

Source: Internet
Author: User

Now I have the problem, and then through the book to get the following conclusions. Hope to point out the mistakes together to learn.

First look at the following code:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/74/B8/wKioL1YnevzTqM6oAAARehnEBXw304.gif "title=" 123. GIF "alt=" Wkiol1ynevztqm6oaaarehnebxw304.gif "/>

This code is wrong: because you define a pointer variable of type int, arr, but you pass + + is its point to other people's space, so it will error.

The error is as follows:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/74/BB/wKiom1Yne6bApadxAAARmzc-mcI586.gif "title=" 321. GIF "alt=" Wkiom1yne6bapadxaaarmzc-mci586.gif "/>

Summarize:

So if you want to execute arr++, arr must point to an array of type int.

First Understanding C 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.