Essence of C/C ++ left-value conversion (3) Left-value conversion

Source: Internet
Author: User

 Essence of C/C ++ left

(3) Conversion of left values

 

The conversion of the Left value is also called the conversion from the left value to the right value. The conversion of the Left value is generally due to two reasons:

First, some operators only require the right-value operands, such as the + and-binary operators. If they are given a left-value operand, the left value must be converted to the right value;

Second, some specifiers, such as arrays and functions, cannot be considered numerical because they do not belong to the scalar type, that is, the entity itself cannot be considered a numerical value. These specifiers are to be involved in expression calculation, it must be converted into a numeric value. The result of the numeric value is different from the value of a common object, but the object address.

Therefore, for the above reasons, the left value conversion is divided into three types: conversion from the left value to the right value, conversion from the array to the pointer, and conversion from the function to the pointer. C ++ defined the three types of left-value Conversion Based on the need of function overload resolution, but C only proposed the terms and did not propose the concept.

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.