I. type conversion
1. automatic conversion (implicit conversion)
2. Forced conversion (display conversion)
1) Use (). () Is the converted data type and can only be converted to the same category
Example: float;
Double B = 3.14;
A = (float) B;
2) use
The auto-increment operator ++ is used to increase the value of the current variable by 1. Generally, the auto-increment operator is more efficient than the expression + 1. Therefore, many
Program The operator is preferred.
However, you must pay
I. Stability
1 parameter detection
2. After the memory is released, set it to null.
3 if statements always have else branches
4. The switch statement always has a default branch, and each case has a break, which must be explained.
5. Write as few as
The path to C ++ primer (fifth edition)-Chapter 4: expressions, C Language
[Disclaimer: All Rights Reserved. indicate the source for reprinting. Do not use it for commercial purposes. Contact mailbox: libin493073668@sina.com]
4.1 Basics
1. The
Detailed explanation of the overload of the Meta operator in C ++ programming, detailed explanation of the overload of the c Operator
The reloaded unary operators are as follows:
! (Logical "not ")
& (ACCESS)
~ (Binary anticode)
* (Cancel
As a powerful and widely used programming language, JavaScript scripting language is based on data types, variables, operators, functions, and core statements. This article mainly introduces the basic knowledge of JavaScript scripting language.
I.
1. CommentsSingle-line CommentAnnotations act as explanations to the code, and annotations are for programmers, not programs./*Multi-line commentsXcode shortcut KeysSelect All Cmd+aCopy Cmd+cPaste Cmd+vSet cmd+,Comment cmd+/Run Cmd+rCompiling cmd+b*/
C-language operators and their precedence summary table formulasRound down ARROW one commaExtraordinary increase and decrease the length of strong needlesThree multiplication, four plus minus, five shifts.Don't forget the fish, it's in Sheng Fan's
Introduction to C + + iterator basicsIterators provide access to objects in a container, and define the scope of the objects in the container. An iterator is like a pointer. In fact, C + + pointers are also an iterator. However, iterators are not
Operator arithmetic operators:Addition (+) subtraction (-) multiplication (*) Division (/) modulus (%)Addition:String type: concatenation of strings.Division:1.0/0 Display Infinity Infinity0.0/0.0 Show Nan:not A number is not a numeric value0.0/0.0 =
I. Iterator type of containerEach container type defines its own iterator type, such as vector: Vector::iterator ITER; This character statement defines a variable named ITER whose data type is the iterator type defined by vector. Each standard
Naming Conventions are necessary to enhance the readability of the Code, so that you can understand what you want to express at a Glance. Standards are rules that make the code easier for later maintenance, it can also greatly improve the
In C and C + +, the self-increment (+ +) and decrement (-) operators are often used in expressions to increase the value of a variable by 1 or minus 1, for example:++i (before using I, the value of I is added 1, if the original value of I is 3,
What is the difference between adding 1 by prefix and adding 1 by suffix? prefix 1 and
The increment operator ++ is a unary operator. The increment operator can appear before the variable as the prefix or suffix after the variable. What is the
The content of this section is a bit dull, but very simple, remember, just like in elementary school we just learned subtraction mixed operation. Remember the priority of the operation. (Of course, if you have a C language or other basis, you can
Since the operator priority of C language is not exactly the same as that of C ++ (mainly adding several operators), this phrase cannot be fully used in C ++. but it should be compatible. You can compare their differences and quickly grasp the
When reading C ++ primerCode:
Istream_iterator Int> In_iter (CIN );//Read ints From CINIstream_iterator Int> EOF;//Istream "end" iterator//Read until end of file, storing what read in VECWhile(In_iter! =EOF ){//Increament advances the stream to
++ Operator
The increment operator (++) Increments its operand by 1. The increment operator can appear before or after its operandIncremental operators (++) Add the operand to 1. Incremental operators can appear before or after operands.
The
I love thinking in series, so I started this name. The idea of this article is also part of this set of books, for example, comparison, or in-depth mining, or to make up for wisdom, or to make sense, including thinking in C ++, it even includes
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.