The use of C++ expressions and operators
This article is mainly about the use of C++ expressions and operators. Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn the use of C++ expressions and operators.
C++ expression
Today we take a brief look at expressions in C++, so what are expressions? What I understand is an expression that represents the operational relationship between operands, so how is it realized to represent the operational relationship between operands? Is implemented by operators, which are actually the key to expressions. Let's focus on operators.
Unary operator and binocular operator
Operators can be divided into monocular algorithm and binocular operator. The so-called monocular operator requires only one Operand, such as the address character (&), and the dereference operator (*) mentioned earlier in vector and array. In C language, it is often used to take the value of the content stored in an address, so it is also called the value operator.
# include
Int main () {
Int num = 10
Std::vector vec1= {1, 2, 3, 4}
For (auto 1 = vec1.begin (); 1! = vec1.end (); + + I)
Std::cout