Linux C pointer problem

Source: Internet
Author: User

char ch = ' a ';

Char *CP = &ch;

= ++*cp++;

How do you explain the third sentence?



= ++*cp++;

Should be illegal as an lvalue (on the left side of the equals sign), as the right value (that is, the right side of the equals sign), how to explain???



I've seen it, and the result is this:
=++ (* (cp++));
Due to the suffix, the system first produces a copy of the CP, then the CP original value indirectly accesses the content, then adds 1 to the content.
As a result, a becomes B.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4F/CC/wKiom1Rh2aiCnHn9AAItoSKzbqc812.jpg "title=" pointer operation problem "alt=" Wkiom1rh2aicnhn9aaitoskzbqc812.jpg "/>

This article is from the "drink tea while watching" blog, please be sure to keep this source http://yale1234.blog.51cto.com/2223964/1575446

Linux C pointer problem

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.