December 2013
Beginner
656 pages
16h 42m
English
EXPLORATION 4
![]()
Strings
In 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.
Listing 4-1. Different Styles of String Output
#include <iostream> int main(){ std::cout << "Shape\tSides\n" << "-----\t-----\n"; std::cout << "Square\t" << 4 << '\n' << "Circle\t?\n";}
Predict the output from the program in Listing 4-1. You may already know what \t means. If so, this prediction is easy to make. If you don’t know, take a guess.
_____________________________________________________________ ...
Read now
Unlock full access