C++ Brain Teasers : Exercise Your Mind

Saved in:
Bibliographic Details
Title: C++ Brain Teasers : Exercise Your Mind
Description: C++ is famous for getting all the default behaviors wrong and for sometimes making demons fly out of your nose. Through 25 puzzles, from the useful to the outright weird, we explore some of C++'s most interesting quirks. How does initialization actually work? Do temporaries even exist? Why is `+!!''` a valid expression in C++? As you work through each puzzle, you will peel off some of the layers of complexity of C++, getting a fundamental understanding of how the language works. This will help you write better code and recognize issues more easily while debugging. Each puzzle in the book is a complete, seemingly simple C++ program, but can you figure out the output for each, or will the answers stump you? Most of the programs compile and have deterministic, though sometimes surprising, output. Some might, however, have undefined behavior, where anything can happen, including making demons fly out of your nose! Yet others might have unspecified behavior with output that is not completely deterministic; we just know nothing as bad as nasal demons will happen. All puzzles are accompanied by detailed discussions, taking a look under the hood at what exactly is going on to help you understand more about C++'s unexpected behaviors, as well as fundamental concepts like initialization, overload resolution, and implicit conversions. For the non-deterministic cases, we'll explore some typical behaviors one can expect to see in practice, what causes them, and why they shouldn't be relied on. After working through the book, you'll have tools and techniques to help you write better and safer code, and a better understanding of the fundamentals of the language, the background for some of C++'s apparent weirdness, and a better feel for identifying bugs and unsafe code in your own programs. What You Need: The book assumes basic knowledge of C++. If you want to run the programs yourself, you can use either a local C++ compiler or the online compilers at https://godbolt.org.
Authors: Anders Schau Knatten
Resource Type: eBook.
Subjects: Puzzles, C++ (Computer program language)
Categories: COMPUTERS / Languages / C++, COMPUTERS / Programming / Algorithms, GAMES & ACTIVITIES / Puzzles
Database: eBook Collection (EBSCOhost)
FullText Links:
  – Type: ebook-pdf
  – Type: ebook-epub
Text:
  Availability: 0
Header DbId: nlebk
DbLabel: eBook Collection (EBSCOhost)
An: 4021582
RelevancyScore: 1123
AccessLevel: 6
PubType: eBook
PubTypeId: ebook
PreciseRelevancyScore: 1122.83581542969
IllustrationInfo
ImageInfo – Size: thumb
  Target: https://rps2images.ebscohost.com/rpsweb/othumb?id=NL$4021582$PDF&s=r
– Size: medium
  Target: https://rps2images.ebscohost.com/rpsweb/othumb?id=NL$4021582$PDF&s=d
Items – Name: Title
  Label: Title
  Group: Ti
  Data: C++ Brain Teasers : Exercise Your Mind
– Name: Abstract
  Label: Description
  Group: Ab
  Data: C++ is famous for getting all the default behaviors wrong and for sometimes making demons fly out of your nose. Through 25 puzzles, from the useful to the outright weird, we explore some of C++'s most interesting quirks. How does initialization actually work? Do temporaries even exist? Why is `+!!''` a valid expression in C++? As you work through each puzzle, you will peel off some of the layers of complexity of C++, getting a fundamental understanding of how the language works. This will help you write better code and recognize issues more easily while debugging. Each puzzle in the book is a complete, seemingly simple C++ program, but can you figure out the output for each, or will the answers stump you? Most of the programs compile and have deterministic, though sometimes surprising, output. Some might, however, have undefined behavior, where anything can happen, including making demons fly out of your nose! Yet others might have unspecified behavior with output that is not completely deterministic; we just know nothing as bad as nasal demons will happen. All puzzles are accompanied by detailed discussions, taking a look under the hood at what exactly is going on to help you understand more about C++'s unexpected behaviors, as well as fundamental concepts like initialization, overload resolution, and implicit conversions. For the non-deterministic cases, we'll explore some typical behaviors one can expect to see in practice, what causes them, and why they shouldn't be relied on. After working through the book, you'll have tools and techniques to help you write better and safer code, and a better understanding of the fundamentals of the language, the background for some of C++'s apparent weirdness, and a better feel for identifying bugs and unsafe code in your own programs. What You Need: The book assumes basic knowledge of C++. If you want to run the programs yourself, you can use either a local C++ compiler or the online compilers at https://godbolt.org.
– Name: Author
  Label: Authors
  Group: Au
  Data: <searchLink fieldCode="AR" term="%22Anders+Schau+Knatten%22">Anders Schau Knatten</searchLink>
– Name: TypePub
  Label: Resource Type
  Group: TypPub
  Data: eBook.
– Name: Subject
  Label: Subjects
  Group: Su
  Data: <searchLink fieldCode="DE" term="%22Puzzles%22">Puzzles</searchLink><br /><searchLink fieldCode="DE" term="%22C%2B%2B+%28Computer+program+language%29%22">C++ (Computer program language)</searchLink>
– Name: SubjectBISAC
  Label: Categories
  Group: Su
  Data: <searchLink fieldCode="ZK" term="%22COMPUTERS+%2F+Languages+%2F+C%2B%2B%22">COMPUTERS / Languages / C++</searchLink><br /><searchLink fieldCode="ZK" term="%22COMPUTERS+%2F+Programming+%2F+Algorithms%22">COMPUTERS / Programming / Algorithms</searchLink><br /><searchLink fieldCode="ZK" term="%22GAMES+%26+ACTIVITIES+%2F+Puzzles%22">GAMES & ACTIVITIES / Puzzles</searchLink>
PLink https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&db=nlebk&AN=4021582
RecordInfo BibRecord:
  BibEntity:
    Classifications:
      – Code: 005.133
        Scheme: ddc
        Type: prePub
    Languages:
      – Code: eng
        Text: English
    Subjects:
      – SubjectFull: Puzzles
        Type: general
      – SubjectFull: C++ (Computer program language)
        Type: general
    Titles:
      – TitleFull: C++ Brain Teasers : Exercise Your Mind
        Type: main
  BibRelationships:
    HasContributorRelationships:
      – PersonEntity:
          Name:
            NameFull: Anders Schau Knatten
      – PersonEntity:
          Name:
            NameFull: Anders Schau Knatten
    IsPartOfRelationships:
      – BibEntity:
          Dates:
            – D: 01
              M: 01
              Type: published
              Y: 2024
            – D: 25
              M: 09
              Type: profile
              Y: 2024
          Identifiers:
            – Type: isbn-print
              Value: 9798888650516
            – Type: isbn-electronic
              Value: 9798888651001
            – Type: isbn-electronic
              Value: 9798888650998
          Titles:
            – TitleFull: C++ Brain Teasers : Exercise Your Mind
              Type: main
ResultId 1