Ready to learn programming with less effort and more fun? Then do it the lazy way! C++20 for Lazy Programmers uses humor and fun to make you actually willing to read and eager to do the projects as you master the popular and powerful C++ language. Along the way it includes many features from the new C++20 standard, such as ranges, spans, format strings, the "spaceship" operator, and concepts (template parameter requirements), and provides brief introductions to modules and coroutines.
With this unique method, you'll stretch your abilities with a variety of projects, including your own C++ arcade game. You'll construct your own classes, templates, and abstract data types. After reading and using this book you'll be ready to build real-world C++ applications and game projects on your own.
You will:
  • Be one of the first to program in the brand-new C++20 standard
  • Discover the SDL graphics and gaming library, and SSDL, the "Simple SDL" wrapper library
  • Get detailed help using the most common C++ compilers -- Visual Studio for Windows, and g++ (with Unix or MinGW) -- and their associated debuggers
  • Practice "anti-bugging" for easy fixes to common problems
  • Learn new concepts and skills from a variety of examples
  • Develop sound practices for becoming a productive programmer
  • Build a C++-based arcade game
  • Apply built-in Standard Template Library (STL) functions and classes for easy and efficient programming
  • Learn powerful data types including strings, stacks, vectors, and linked lists -- not by reading about them but by building them -- preparing you further for a career in programming



Autorentext
Will Briggs, PhD is a professor of computer science at the University of Lynchburg in Virginia.  He has 20+ years of experience teaching C++, 12 of them using earlier drafts of this book, and about as many years teaching other languages including C, LISP, Pascal, PHP, PROLOG, and Python.  His primary focus is teaching of late while also active in research in artificial intelligence.


Inhalt
Introduction1-1

1Getting started1-9
1.1A simple program1-9
1.2Creating an SSDL project1-12
1.3Shapes and the functions that draw them1-27
1.4consts and colors1-35
1.5Text1-37 
Prominent examples from this chapter:  a drawing of a bug's head; a neatly printed poem.

2Images and sound2-43
2.1Images and changing window characteristics2-43
2.2Multiple images together2-48
2.3Adding transparency with GIMP2-50
2.4Sound2-54
Example:  a slide show (Your yard gnome's travel pics).

3Math: types, operations, consts, and math functions3-56
3.1Variables3-56
3.2const, constexpr, constinit3-57
3.3Math operators3-59
3.4Built-in functions and casting3-62
Examples:  diver on a diving board; a 5-pointed star.
C++20 updates:  constexpr, constinit.

After this chapter, constexpr/constinit show up in most examples.

4Mouse, and if4-67
4.1Mouse functions4-67
4.2if4-69
4.3Boolean values and variables4-73
4.4A hidden-object game4-75
Example:  The hidden-object game.

5Loops and text input5-79
5.1Keyboard input5-79
5.2while and do-while5-81
5.3for loops5-85
5.4chars and cctype5-90
5.5switch5-94
Examples:  the Monty Hall problem; menus.

6Algorithms and the development process6-97
6.1Adventures in robotic cooking6-97
6.2Writing a program from start to finish6-100

Example: a bullseye pattern.

7Functions7-106
7.1Functions that return values7-106
7.2Functions that return nothing7-109
7.3Global variables and why they're evil7-111
7.4How to write a function in four easy steps (and call it in one)7-113
7.5Why have functions, anyway?7-117
Example:  a multi-frame comic (illustrates code reuse). 

8Functions (Continued)8-126
8.1Random numbers8-126
8.2Boolean functions8-131
8.3Multiple values provided:  using & parameters8-133
8.4Identifier scope8-138
8.5A final note on algorithms8-140 
Examples:  various functions using random number generation.

9Using the debugger9-141
9.1A flawed program9-141
9.2Breakpoints and watched variables9-145
9.3Fixing the stripes9-145
9.4Going into functions9-149
9.4Fixing the stars9-149
9.4Wrap-up9-150
9.4Other debugging techniques9-153
9.4More on antibugging9-156

Example: a national flag.

10Arrays and enum class10-159
10.1Arrays10-159
10.2Arrays as function parameters10-160
10.3enum class10-166
10.4Multidimensional arrays10-166
Examples: monthly temperatures, checkers, tic-tac-toe.
C++20 update: using enum class (which significantly improves the usefulness of enum class).

11Animation with structs and sprites11-173
11.1struct11-173
11.2Making a movie with struct and while11-176
11.3Sprites11-182
Examples:  bouncing balls; a video aquarium.
C++20 update:  designated initializers for structs.

12Building your own arcade game:  input, collisions, and putting it all together12-188
<...
Titel
C++20 for Lazy Programmers
Untertitel
Quick, Easy, and Fun C++ for Beginners
EAN
9781484263068
Format
E-Book (pdf)
Hersteller
Veröffentlichung
11.12.2020
Digitaler Kopierschutz
Wasserzeichen
Dateigrösse
14.07 MB
Anzahl Seiten
677