A small problem with the end of while (std::cin >> word)------

Source: Internet
Author: User

or in the C + + bar problem, someone asked how to terminate the shape as while (Std::cin >>word) {/* do something */}, except with Ctrl +c.

I thought the following must be a group of people to answer Ctrl + Z, the result is still my wishful thinking, many people also said that it is a cycle of death, not to add a conditional break out to be saved, like this should be dragged down with C + + primer hit dead ... Of course, I also do not even a calf, so I tried, the amount is in the win8.1 Pro environment with the VC + + 12.0 compiler, the result is this:

Where did I see a saying that when you enter the command line, spaces, tabs, and carriage returns can be used to break the input characters, so I use the stupidest method:

Enter a word specifier +ctrl+z

Enter a character after a space, CTRL + Z

Enter a character, tab, CTRL + Z

......

Finally found only feasible is to enter a period of characters, enter, CTRL + Z.

Of course, I do not know the reason why it is not like I do, so after reading a friend's blog, only to understand the details.

Above.

A small problem with the end of while (std::cin >> word)------

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.