{"product_id":"c20-for-lazy-programmers-9781484263051","title":"C20 for Lazy Programmers","description":"\u003cb\u003eBook Synopsis\u003c\/b\u003e\u003cbr\u003e\u003cdiv\u003e\u003cdiv\u003e\n\u003cp\u003eReady 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.\u003c\/p\u003eWith 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.\u003cp\u003e\u003c\/p\u003e\n\u003cp\u003e\u003cb\u003eWhat You Will Learn:\u003c\/b\u003e\u003c\/p\u003e\n\u003cp\u003e\u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eThe brand-new C++20 standard\u003c\/li\u003e\n\u003cli\u003eProgramming graphics and games with the SDL library, using SSDL, the Simple SDL wrapper libra\u003cbr\u003e\u003cbr\u003e\u003cb\u003eTable of Contents\u003c\/b\u003e\u003cbr\u003eIntroduction\t1-1\u003cbr\u003e1\tGetting started\t1-91.1\tA simple program\t1-91.2\tCreating an SSDL project\t1-121.3\tShapes and the functions that draw them\t1-271.4\tconsts and colors\t1-351.5\tText\t1-37 Prominent examples from this chapter:  a drawing of a bug's head; a neatly printed poem.\u003cbr\u003e2\tImages and sound\t2-432.1\tImages and changing window characteristics\t2-432.2\tMultiple images together\t2-482.3\tAdding transparency with GIMP\t2-502.4\tSound\t2-54Example:  a slide show (Your yard gnome's travel pics).\u003cbr\u003e3\tMath: types, operations, consts, and math functions\t3-563.1\tVariables\t3-563.2\tconst, constexpr, constinit\t3-573.3\tMath operators\t3-593.4\tBuilt-in functions and casting\t3-62Examples:  diver on a diving board; a 5-pointed star.C++20 updates:  constexpr, constinit.\u003cbr\u003eAfter this chapter, constexpr\/constinit show up in most examples.\u003cbr\u003e4\tMouse, and if\t4-674.1\tMouse functions\t4-674.2\tif\t4-694.3\tBoolean values and variables\t4-734.4\tA hidden-object game\t4-75Example:  The hidden-object game.\u003cbr\u003e5\tLoops and text input\t5-795.1\tKeyboard input\t5-795.2\twhile and do-while\t5-815.3\tfor loops\t5-855.4\tchars and cctype\t5-905.5\tswitch\t5-94Examples:  the Monty Hall problem; menus.\u003cbr\u003e6\tAlgorithms and the development process\t6-976.1\tAdventures in robotic cooking\t6-976.2\tWriting a program from start to finish\t6-100\u003cbr\u003eExample: a bullseye pattern.\u003cbr\u003e7\tFunctions\t7-1067.1\tFunctions that return values\t7-1067.2\tFunctions that return nothing\t7-1097.3\tGlobal variables and why they're evil\t7-1117.4\tHow to write a function in four easy steps (and call it in one)\t7-1137.5\tWhy have functions, anyway?\t7-117Example:  a multi-frame comic (illustrates code reuse). \u003cbr\u003e8\tFunctions (Continued)\t8-1268.1\tRandom numbers\t8-1268.2\tBoolean functions\t8-1318.3\tMultiple values provided:  using \u0026amp; parameters\t8-1338.4\tIdentifier scope\t8-1388.5\tA final note on algorithms\t8-140 Examples:  various functions using random number generation.\u003cbr\u003e9\tUsing the debugger\t9-1419.1\tA flawed program\t9-1419.2\tBreakpoints and watched variables\t9-1459.3\tFixing the stripes\t9-1459.4\tGoing into functions\t9-1499.4\tFixing the stars\t9-1499.4\tWrap-up\t9-1509.4\tOther debugging techniques\t9-1539.4\tMore on antibugging\t9-156\u003cbr\u003eExample: a national flag.\u003cbr\u003e10\tArrays and enum class\t10-15910.1\tArrays\t10-15910.2\tArrays as function parameters\t10-16010.3\tenum class\t10-16610.4\tMultidimensional arrays\t10-166Examples: monthly temperatures, checkers, tic-tac-toe.C++20 update: using enum class (which significantly improves the usefulness of enum class).\u003cbr\u003e11\tAnimation with structs and sprites\t11-17311.1\tstruct\t11-17311.2\tMaking a movie with struct and while\t11-17611.3\tSprites\t11-182Examples:  bouncing balls; a video aquarium.C++20 update:  designated initializers for structs.\u003cbr\u003e12\tBuilding your own arcade game:  input, collisions, and putting it all together\t12-18812.1\tDetermining input states\t12-18812.2\tEvents\t12-19012.3\tCooldowns and lifetimes\t12-19112.4\tCollisions\t12-19412.5\tThe big game\t12-195Examples: an arcade game, and the student's own game.\u003cbr\u003e13\tStandard I\/O and file operations\t13-20413.1\tStandard I\/O programs in Visual C++ and g++\t13-20413.2\tFile I\/O (optional)\t13-210Examples:  various programs reading\/writing text files.  Except for Chapter 21 (virtual functions), this and subsequent chapters use standard console I\/O, not the SSDL graphics library.  If used for a course, this chapter likely ends the first semester, so if students are going into a class with a different textbook, they are ready for the console I\/O it will certainly require them to know.\u003cbr\u003e14\tCharacter arrays and dynamic memory (pointers)\t14-22114.1\tCharacter arrays\t14-22114.2\tDynamic allocation of arrays.\t14-22414.3\tUsing the * notation\t14-228Examples:  C's string functions, written as examples or offered as exercises; code with new and deleteC++20 updates: array size deduction in new expressions.\u003cbr\u003e15\tClasses:  the basics\t15-23215.1\tWriting classes\t15-23215.2\tConstructors\t15-23515.3\tconst objects, const member functions...\t15-23915.4\t...and const parameters\t15-24115.5\tMultiple constructors\t15-24115.6\tDefault parameters for code reuse\t15-24415.7\tDate program (so far)\t15-245Examples:  the Date class; the student's own Time class.\u003cbr\u003e16\tClasses, continued\t16-24816.1\tinline functions for efficiency\t16-24816.2\tAccess functions\t16-24916.3\tstatic members, inline, and constexpr\/constinit\t16-25016.4\tSeparate compilation and include files\t16-25216.5\tMultiple-file projects in Microsoft Visual C++\t16-25716.7\tMultiple-file projects in g++\t16-25916.8\tFinal Date program\t16-264Examples:  the Date class; the student's own Time class, continued.C++20 updates: constexpr\/consteval member functions; constexpr\/constinit data members and their interaction with static.\u003cbr\u003e17\tOperators, and destructors\t17-26817.1\tThe basic string class\t17-26817.2\tDestructors\t17-27017.3\t== and != operators\t17-27117.3\tOther comparison operators, using the spaceship operator\t17-27117.4\tAssignment operators and *this\t17-27317.5\tArithmetic operators\t17-27517.6\t[] and () operators\t17-27917.7\t\u0026gt;\u0026gt; and \u0026lt;\u0026lt;: operators that aren't class members\t17-28117.8\t++ and --\t17-28317.9\tExplicit call to constructor\t17-28417.10\t.The final String class\t17-28517.11\t#include \t17-291Examples:  a String class; the student's own Point or Fraction class.C++20 updates:  implicit != operator; the three-way \"spaceship\" () operator.\u003cbr\u003e18\tExceptions, recursion, and O notation\t18-29218.1\tExceptions\t18-29218.1\tMove constructors and move = (optional)\t18-29618.2\tRecursion (optional; used in the next section)\t18-30018.3\tAlgorithm analysis and O-notation (optional)\t18-303Examples:  a Stack class; a factorial function; binary and linear search.\u003cbr\u003e19\tClasses, continued:  inheritance\t19-30919.1\tThe basics of inheritance\t19-30919.2\tConstructors and destructors\t19-31219.2\tInheritance as a concept\t19-31219.3\tAn inheritance heirarchy, and public\/private inheritance\t19-31419.4\tModules: the modern way to maintain libraries\t19-314Examples:  card games.C++20 update: modules. \u003cbr\u003e20\tTemplate functions and classes\t20-33520.1\tFunction templates\t20-33520.2\tThe Vector class\t20-33820.3\tMaking Vector a template\t20-34120.4\tUnusual class templates (optional)\t20-34520.5\t#include ^t;\t20-346C++20 updates: concepts; class template argument deduction for aggregates.\u003cbr\u003e21\tMultiple inheritance and virtual functions\t21-34721.1\tVirtual functions\t21-34721.2\tMultiple inheritance\t21-357Example:  a Shape class.  This chapter uses the SSDL library.C++20 updates: if it fits with the examples, constexpr virtual functions. \u003cbr\u003e22\tLinked lists\t22-35922.1\tWhat lists are and why have them\t22-35922.2\tThe (default) constructor\t22-36322.3\tpush_front\t22-36322.4\tpop_front\t22-36522.5\tThe destructor\t22-36722.6\t-\u0026gt;:  a bit of syntactic sugar\t22-36722.7\tA bit more friendly syntax:  pointers as conditions\t22-36722.8\tThe linked list template\t22-36822.9\t#include \t22-371Example:  the List class.\u003cbr\u003e23\tThe Standard Template Library (STL)\t23-37123.1\tIterators\t23-37123.2\tGetting really lazy: ranges and auto\t23-37523.3\tInitializer lists (optional)\t23-37623.4\talgorithm (optional)\t23-375Example:  an extension of the List class to use iterators.C++20 updates: initialization statements in range-based for loops (Section 23.2); std::span (23.2); parenthesized initialization of aggregates (23.3); simplified erase*\/remove* functions (23.4).\u003cbr\u003eIf this is used for a class, the second semester likely ends with Chapter 19 or 20.  Remaining chapters are extras for those who want to go further.\u003cbr\u003e\u003cbr\u003e24\tBuilding bigger projects\t24-37724.1\tNamespaces\t24-37724.2\tConditional compilation\t24-37824.3\tLibraries\t24-378\u003cbr\u003e25\tHistory\t25-38225.1\tSIMULA 67\t25-38225.2\tSmalltalk\t25-38225.3\tWhat \"object-oriented\" is\t25-38325.4\tC\t25-38325.5\tC++\t25-38326.6\tC++'s evolving standards, C++98 to C++20\t25-383\u003cbr\u003e26\tEsoterica (recommended)\t26-38526.1\tFormatted output (fmt)\t26-38526.2\tCommand-line arguments\t26-38726.3\tstatic_cast et al\t26-38926.4\tDefaulted constructors and =\t26-39126.5\tUser-defined literals: let C++ handle your units for you\t26-39326.6\tLambda functions for one-time use\t26-39526.7\tSructured bindings: returning multiple values at once\t26-39826.8\tSmart pointers\t26-40026.9\tBit twiddling:  \u0026amp;, |, and ~\t26-402\u003cbr\u003eC++20 updates: Formatted output; std::make_shared()'s support for arrays (Section 26.8).\u003cbr\u003e27\tEsoterica (not so recommended)\t27-40427.1\tprotected sections\t27-40427.2\tTemplate specialization\t27-40527.3\tfriends and why you shouldn't have any\t27-40527.4\tUser-defined conversions\t27-408\u003cbr\u003e28\tC\t28-41228.1\tCompiling C\t28-41228.2\tI\/O\t28-41428.3\tParameter passing with *\t28-42128.4\tDynamic memory\t27-423Examples:  programs using C's stdio functions (printf, sscanf, etc.).\u003cbr\u003e29\tMoving on with SDL\t29-42429.1\tA basic program in SDL\t29-42429.2\tCompling\t29-42629.3\tFurther resources\t29-427\u003cbr\u003e\u003cbr\u003eAppendicesA.\tSetting up SDL and SSDL\t427B.\tOperators\t429C.\tASCII codes\t429D.\tEscape sequences\t430E.\tBasic C standard library\t432F.\tSSDL reference\t435\u003cbr\u003eIndex\t448\u003cbr\u003eReferences\t455\u003cbr\u003e\u003cbr\u003e\n\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003c\/div\u003e\u003c\/div\u003e","brand":"APress","offers":[{"title":"Default Title","offer_id":51019939709271,"sku":"9781484263051","price":41.24,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0817\/1739\/5799\/files\/9781484263051.jpg?v=1750781813","url":"https:\/\/bookcurl.com\/products\/c20-for-lazy-programmers-9781484263051","provider":"Book Curl","version":"1.0","type":"link"}