Skip to main content

Loops, Input, and char

  • Chapter
  • First Online:
C++ for Lazy Programmers
  • 4529 Accesses

Abstract

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 to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  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.

    Some compilers aren’t up to speed on this, and let the variables stay defined after the loop. Solution: declare the variable before the loop. Better yet, upgrade your compiler.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Will Briggs

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Briggs, W. (2019). Loops, Input, and char. In: C++ for Lazy Programmers. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5187-4_5

Download citation

Publish with us

Policies and ethics