Skip to main content

Loops, Input, and char

  • 2493 Accesses


In this chapter, we'll look at repeated actions, input, and things to do with the character type.

This is a preview of subscription content, log in via an institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions


  1. 1.

    I could have called it sin and waited for the puns to start, but sin already means something in C++: the sine function. “S-in” might be a good way to pronounce it.

  2. 2.

    This is from the g++ compiler. Visual Studio gave me three lines and clearly identified << as the problem. Nice!

  3. 3.

    A “byte” is a single memory location, big enough on all systems I’ve heard of to store one char.

Author information

Authors and Affiliations


Rights and permissions

Reprints and permissions

Copyright information

© 2021 Will Briggs

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Briggs, W. (2021). Loops, Input, and char. In: C++20 for Lazy Programmers. Apress, Berkeley, CA.

Download citation

Publish with us

Policies and ethics