小苏子
小苏子PDF在线图书

C++ By Example 二 精彩文摘

C++ By Example 二 精彩文摘

Using C++ Math Operators and PrecedenceIf you are dreading this chapter because you don’t like math—relax,C++ does all your math for you! It is a misconception that you have to be good at math to understand how to program computers. In fact, programming practice assumes the opposite is true! Your computer is your “slave,” to follow your instructions, and to do all the calculations for you. This chapter explains how C++ computes by introducing you too Primary math operatorso Order of operator precedenceo Assignment statementso Mixed data type calculationso Type castingChapter 8 o Using C++ Math Operators and PrecedenceMany people who dislike math actually enjoy learning how the computer handles it. After learning the math operators and a few simple ways in which C++ uses them, you should feel comfortable using calculations in your programs. Computers are fast, and they can perform math operations much faster than you can!C++’s Primary Math OperatorsA C++ math operator is a symbol used for adding, subtracting,multiplying, dividing, and other operations. C++ operators are not always mathematical in nature, but many are. Table 8.1 lists these operator symbols and their primary meanings…….

赞(0)
未经允许不得转载:小苏子图书 » C++ By Example 二 精彩文摘