https://doi.org/10.1007/978-3-322-87317-0In Exploration 4, you used tab characters to line up output neatly. Tabs are useful, but crude. This Exploration introduces some of the features that C++ offers to format output nicely, such as setting the alignment, padding, and width of output fields.
Schlachttier-Fleischvergiftungen,The previous Exploration introduced the increment (++) operator to advance an iterator. This operator works on numeric types, as well. Not surprisingly, it has a decrement counterpart: --. This Exploration takes a closer look at these operators, which appear so often they are part of the language name.
http://reply.papertrans.cn/33/3203/320260/320260_23.png
https://doi.org/10.1007/978-3-663-04903-6In Exploration 2,I introduced you to character literals in single quotes, such as ‘
’ to end a line of output, but I have not yet taken the time to explain these fundamental building blocks. Now is the time to explore characters in greater depth.
http://reply.papertrans.cn/33/3203/320260/320260_25.png
Reading C++ CodeI suspect you already have some knowledge of C++. Maybe you already know C, Java, Perl, or other C-like languages. Maybe you know so many languages that you can readily identify common elements. Let’s test my hypothesis. Take a few minutes to read Listing 2–1 then answer the questions that follow it.
Integer ExpressionsIn Exploration 2, you examined a program that defined a few variables and performed some simple operations on them. This Exploration introduces the basic arithmetic operators. Read Listing 3–1 then answer the questions that follow it.
StringsIn earlier Explorations, you used quoted character strings as part of each output operation. In this Exploration, you will begin to learn how to make your output a little fancier by doing more with strings. Start by reading Listing 4–1.
Simple InputSo far, the Explorations have focused on output. Now it’s time to turn your attention to input. Given that the output operator is “,
http://reply.papertrans.cn/33/3203/320260/320260_30.png