1.2.2 A program that uses the IO library
1. Write to stream
- << is the output operator
- Each expression in C + + produces a result, typically the value that the operator uses for the operand.
- For example Std::cout << "Enter 2 numbers:";
- There is an output operator in this <<
- The left operand is an object cout the Ostream class type, and the right operand is a string
- Use the operator << the operand "Enter 2 numbers:" And the resulting value is Ostream object cout
- Connect output requests together Std::cout << "Enter 2 numbers:" << Std::endl;
- Std::cout << "Enter 2 numbers:", is an expression that produces the result of an object of type Std::cout,ostream
- Endl
- is a manipulator that has two functions when writing Endl to the output stream,
- 1, the effect of line-wrapping
- 2. Refresh the buffer associated with the device
2. Read the inflow
Chapter I.