C + + Primer Plus Chapter 1 input and output

Source: Internet
Author: User

Iostream contains two basic types: IStream and Ostream.

The standard library defines 4 IO objects: CIN, cout, Cerr (output warning and error message), clog (general information when the output program runs).

Writing data to a stream

such as:std::cout<< "Enter numbers:" <<std::endl;

Where the "<<" operator accepts two operands: the left operand must be an Ostream object, and the operand on the right is the value to be printed. Note: The second operator prints Endl, which is a special value called an operator. The effect of writing it is to end the current line and to brush the contents of the buffer associated with the device to the device.

Reading data from a stream

such as:std::cin>>v1>>v2;

">>" is similar to the "<<" above.

                                                           ,         &NB Sp                         &NBSP;&NBSP  

2017/7/12 recorded in Camphor garden 2 ^_^

C + + Primer Plus Chapter 1 input and output

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.