1. Integer PromotionIn an expression, any place where an int or unsigned int type can be used to do the right value can also use a signed or non - the char, short, and Bit-field symbols. If the value range of the original type can be represented by
C ++ forced type conversion and forced type conversion
The forced Type conversion (Type Cast) of the C style is very simple. No matter what Type conversion is:
TYPE B = (TYPE)
The C ++ style type conversion provides four types of conversion
Abstract LinuxC programming one-stop learning
3.1 Integer Promotion
In an expression, you can use signed or unsigned char, short, and Bit-field characters to make the right value of the int or unsigned int type. If the value range of the original
Valid tive C # item3 prefer the is or as operators to casts.Principle 3: select the is or as operator instead of forced type conversion.
C # is a strong data type language. Good programming practices mean that we should do our best to avoid forced
C ++ BASICS (1) data precision, forced type conversion, variable naming rules, and pig naming rulesPig C ++ BASICS (1) KEYWORDS: data precision, forced type conversion, variable naming rules
Summary:
1. Most programming languages further supplement
Document directory
Strong and weak language
Implicit conversion
New Forced type conversion method
C # Forced type conversion
Strong and weak language
Mainstream programming languages such as C ++, C, Java, and C # are strongly typed, while
C-style forced type conversion (type cast) is simple, no matter what type of conversion is:Type B = (type) aC + + Style type conversion provides 4 types of conversion operators to handle applications in different situations. const_cast, the literal
The purpose of forced type conversion in C language, the basic format, the essential meaning of variables in C, and the essence of Variables C forced type conversion
Reading directory:
1. Purpose and basic format of forced type conversion
Ii.
Obtain the Data Type: to view the value and type of an expression, use var_dump (). If you just want to get an easy-to-understand expression of the type for debugging, use gettype (). To view a type, use the is_type () function instead of gettype. ■
Last time I said something about the expression, and there are some things about data type conversions, today we go on to 818 data type conversions in C + +.One, implicit type conversionIn expressions, some operators can manipulate multiple types of
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.