C++ for Lazy Programmers : Quick, Easy, and Fun C++ for Beginners

電子版価格
¥7,970
  • 電書あり

C++ for Lazy Programmers : Quick, Easy, and Fun C++ for Beginners

  • ただいまウェブストアではご注文を受け付けておりません。 ⇒古書を探す
  • 製本 Paperback:紙装版/ペーパーバック版/ページ数 644 p.
  • 言語 ENG
  • 商品コード 9781484251867
  • DDC分類 005

Full Description


Learn C++ the quick, easy, and "lazy" way. This book is an introductory programming text that uses humor and fun to make you actually willing to read, and eager to do the projects -- with the popular C++ language.C++ for Lazy Programmers is a genuinely fun learning experience that will show you how to create programs in the C++ language. This book helps you learn the C++ language with a unique method that goes beyond syntax and how-to manuals and helps you understand how to be a productive programmer. It provides detailed help with both the Visual Studio and g++ compilers plus their debuggers, and includes the latest version of the language, C++17, too. Along the way you'll work through a number of labs: projects intended to stretch your abilities, test your new skills, and build confidence. You'll go beyond the basics of the language and learn how build a fun C++ arcade game project. After reading and using this book, you'll be ready for your first real-world C++ application or game project on your own. What You Will LearnProgram for the first time in C++ in a fun, quick and easy mannerDiscover the SDL graphics and gaming libraryWork with SSDL, the Simple SDLwrapper libraryUse the most common C++ compilers: Visual Studio, and g++ (with Unix or MinGW)Practice "anti-bugging" for easy fixes to common problems Work with the debuggerAcquire examples-driven concepts and ideas Build a C++-based arcade game application Apply built-in Standard Template Library (STL) functions and classes for easy and efficient programmingDip your toe in C, C++'s ancestor, still extensively used in industryUse new C++11/14/17 features including lambda functions, constexpr, and smart pointersWho This Book Is ForThose who are new to C++, either as a guide for self-learners or as an accessible textbook for students in college-level courses.

Contents

The text is around 120,000 words long. Most chapters take one week each to cover in a standard (3- or 4-hour) college class. It covers two semesters, with a few extra chapters at the end for those wanting to go further.Chapter 1-13 are for semester one, covering variables, constants, types including enumeration types, control structures, functions, standard I/O, programming style, algorithm development, and the debugger. The climax of the sequence is Chapter 12, Building Your Own Arcade Game. As it stands now, all but Chapter 13 use a graphics library for whiz-bang.Chapter 14-23 are for the second semester, covering character arrays, pointers and dynamic memory, classes, inheritance, templates including the Standard Template Library, exceptions, virtual functions, and elementary data structures (strings, stacks, queues, vectors, and lists). The climax of this sequence is the construction of linked lists. Only Chapter 21 uses graphics -- the rest use standard console I/O, which is essential before going on to subsequent classes in the major.Chapters 24-29 are optional extras: namespaces, construction of libraries, history of C++, bit twiddling, sstream, shared_ptr, the C language, and other topics.Appendices cover setting up the graphics library on your machine, escape sequences, keywords, standard libraries, g++ debugger commands, and graphics-library functions.Introduction. 1-11 Getting started. 1-91.1 A simple program.. 1-91.2 Creating an SSDL project 1-121.3 Shapes, and the functions that draw them.. 1-271.4 consts and colors. 1-351.5 Text 1-37 First week.Prominent examples from this chapter: a drawing of a bug's head; a neatly printed poem.2 Images and sound. 2-432.1 Images, and changing window characteristics. 2-432.2 Multiple images together 2-482.3 Sound. 2-51Second week.Example: a slide show (Your yard gnome's travel pics).3 Math: types, operations, consts, and math functions. 3-553.1 Variables, constants, enums as constants. 3-553.2 Math operators. 3-573.3 Mathematical functions. 3-61Third week.Examples: diver on a diving board; a 5-pointed star.4 Mouse, and if. 4-674.1 Mouse functions, and variables associated. 4-674.2 if.. 4-694.3 Boolean variables. 4-734.4 Where Waldo is: using mouse input 4-75Fourth week.Example: Where's Waldo? (pending approval from Waldo's author).5 Loops and text input 5-795.1 Text input 5-795.2 while and do-while. 5-815.3 for-loops. 5-855.4 The char type, and cctype.. 5-905.5 switch.. 5-94Fifth week.Examples: the Monty Hall problem; menus.6 Algorithms and the development process. 6-976.1 The Biscuit Algorithm, or how planning ahead reduces your workload. 6-976.2 Writing a program, from start to finish. 6-100Sixth week.7 Functions. Example: a multi-panel comic. 7-1067.1 Functions that return values. 7-1067.2 Functions that return nothing. 7-1107.3 Why have functions, anyway?. 7-117Still sixth week.Example: a multi-frame comic (illustrates code reuse).8 Functions (cont'd). Example: various random functions. 8-1268.1 Boolean functions. 8-1268.2 Random numbers. 8-1278.3 Multiple values provided: using & parameters. 8-1338.4 Identifier scope 8-1388.5 A final note on algorithms. 8-140 Seventh and eighth weeks.Examples: various functions using random number generation.9 Using the debugger (optional, recommended) 9-1419.1 Example: drawing a flag. 9-1419.2 A debugger session in Visual Studio. 9-1459.3 Debugging g++ programs with ddd and gdb. 9-1509.4 Other common debugging techniques. 9-156Ninth week.10 enum and arrays. 10-15910.1 Enumeration types. 10-15910.2 Arrays. 10-16010.3 Multidimensional arrays. 10-166Tenth week.Examples: checkers, tic-tac-toe.11 animation with structs and sprites. 11-17311.1 struct.. 11-17311.2 Making a movie with struct and while.. 11-17611.3 Sprites. 11-182Eleventh week.Examples: bouncing balls; a video aquarium.12 Building your own arcade game: input, collisions, and putting it all together 12-18812.1 Input for arcade games: determining input states. 12-18812.2 Input for arcade games: events. 12-19012.3 Latency. 12-19112.4 Collisions. 12-19412.5 The big game. 12-195Twelfth and thirteenth weeks.Example: the student's own game.13 Standard I/O and file operations. 13-20413.1 Standard I/O.. 13-20413.2 Compiling in Visual C++. 13-20513.3 Compiling with g++. 13-20913.4 Treating cin and cout as files (optional) 13-21013.5 File I/O using file names (optional) 13-216Fourteenth week.Examples: 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. 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.14 Character arrays and dynamic memory (pointers) 14-22114.1 Character arrays. 14-22114.2 Dynamic allocation of arrays. 14-22414.3 Using the * notation. 14-228Second semester, first week.Examples: C's string functions, written as examples or offered as exercises; code with new and delete15 Classes: the basics. 15-23215.1 A simple class. 15-23215.2 Constructors. 15-23515.3 const objects, const member functions... 15-23915.4 ...and const parameters. 15-24115.5 Multiple constructors. 15-24115.6 Default parameters for code reuse. 15-24415.7 Date program (so far) 15-245Second week.Examples: the Date class; the student's own Time class.16 Classes, continued. 16-24816.1 inline functions for efficiency. 16-24816.2 Access functions. 16-24916.3 static members, and other members of the entire class (optional) 16-25016.4 Separate compilation and include files. 16-25216.5 Backing up a multi-file project 16-25616.6 Separate compilation in Microsoft Visual C++. 16-25716.7 Separate compilation in g++. 16-25916.8 Final Date program.. 16-264Third week.Examples: the Date class; the student's own Time class, continued.17 Operators, and destructors. 17-26817.1 The basic string class -- and default arguments. 17-26817.2 Destructors. 17-27017.3 Binary and unary operators. 17-27117.4 Assignment operators and *this.. 17-27317.5 Arithmetic operators. 17-27517.6 [] and () operators. 17-27917.7&^> and <<: operators that aren't class members. 17-28117.8 ++ and -- 17-28317.9 Some fun with constructors. 17-28417.10 ...the final String class. 17-28517.11 #include .. 17-291Fourth and fifth weeks.Examples: a String class; the student's own Point or Fraction class.18 Exceptions, recursion, and O notation. 18-29218.1 Exceptions. 18-29218.2 Recursion (optional) 18-30018.3 Algorithm analysis and O-notation (optional) 18-303Sixth week.Examples: a Stack class; a factorial function; binary and linear search.19 Classes, continued: inheritance. 19-30919.1 The basics of inheritance. 19-30919.2 Inheritance as a concept 19-31219.3 Calling parent class constructors. 19-31419.4 Inheritance and destructors. 19-31419.5 protected sections. 19-31419.6 Types of inheritance. 19-31519.7 An inheritance hierarchy. 19-319Seventh and eighth weeks.Examples: card games.20 Template functions and classes. 20-33520.1 template functions. 20-33520.2 The Vector class. 20-33820.3 Making Vector a template. 20-34120.4 Unusual class templates (optional) 20-34520.5 #include .. 20-346Ninth week.Example: the Vector class21 Multiple inheritance and virtual functions. 21-34721.1 Multiple inheritance. 21-34721.2 Virtual functions. 21-348Tenth and eleventh weeks.Example: a Shape class. This uses the SSDL library.22 Linked lists. 22-35922.1 What lists are, and why have them.. 22-35922.2 T List::operator[] (int index) const; 22-36322.3 ->: a bit of syntactic sugar 22-36622.4 A bit more friendly syntax: pointers as conditions. 22-36722.5 List::‾List(); 22-36722.6 The linked list class. 22-36822.7 #include .. 22-371Twelfth week.Example: the List class.23 The Standard Template Library (STL) 22-37122.1 Iterators, and auto (C++ 11 on) 22-37122.2 pair.. 22-37522.3 algorithm, and functions using iterators. 22-37522.4 Function pointers and objects. 22-376Thirteenth week.Example: an extension of the List class to use iterators.This likely ends the second semester. If there is extra time, the instructor may choose to add the chapter on C, sstream, iomanip, or some other topic from remaining chapters. Otherwise, remaining chapters are extras for those who want to go further.24 Building bigger projects. 23-37723.1 Namespaces. 23-37723.2 Conditional compilation. 23-37823.3 Libraries. 23-37825 History. 24-38224.1 SIMULA 67. 24-38224.2 Smalltalk. 24-38224.3 What "object-oriented" is. 24-38324.4 C.. 24-38324.5 C++. 24-38326 Esoterica (recommended) 25-38525.1 iomanip. 25-38525.2 Bit twiddling: &, |, and ‾. 25-38925.3 sstream: strings that are I/O streams. 25-38925.4 Command-line arguments. 25-39225.5 Exceptions: more detail 25-39625.6 Template specialization. 25-39925.7 shared_ptr (C++ 11 on) 25-40025.8 cast operators. 25-40125.9 Saving run time with move constructors/move = (C++ 11 on) 25-40225.10 Multiple inheritance with virtual base classes. 25-40227 Esoterica (not so recommended) 26-40426.1 Microsoft Windows help. 26-40426.2 Unix help. 26-40526.3 friends, and why you shouldn't have any. 26-40526.4 pImpls, iosfwd, precompiled headers, and other afflictions. 26-40826.5 Precompiled headers. 26-41128 C.. 27-41227.1 Compiling C.. 27-41227.2 #define. 27-41327.3 stdio.h. 27-41427.4 Parameter passing with *.. 27-42127.5 static global declarations (optional) 27-423Examples: programs using C's stdio functions (printf, sscanf, etc.).29 Moving on with SDL.. 28-42428.1 A basic program in SDL.. 28-426AppendicesA. Setting up SDL and SSDL.. 427B. Making your own SSDL project 429C. Basic types. 429D. Escape sequences. 430E. C++ keywords. 430F. Operators. 432G. ASCII codes. 433H. Standard libraries. 435I. Common gdb commands. 438J. SSDL reference. 440Index 448References. 455