100% found this document useful (9 votes)
16 views

C++20 for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners 2nd Edition Will Briggs instant download

C++20 for Lazy Programmers is a beginner-friendly guide by Will Briggs that emphasizes a fun and engaging approach to learning C++. The book covers essential topics in C++ programming, including graphics with the SDL library, while promoting efficient coding practices. It aims to make programming enjoyable and accessible, with a focus on practical examples and hands-on experience.

Uploaded by

nagibyasso66
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (9 votes)
16 views

C++20 for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners 2nd Edition Will Briggs instant download

C++20 for Lazy Programmers is a beginner-friendly guide by Will Briggs that emphasizes a fun and engaging approach to learning C++. The book covers essential topics in C++ programming, including graphics with the SDL library, while promoting efficient coding practices. It aims to make programming enjoyable and accessible, with a focus on practical examples and hands-on experience.

Uploaded by

nagibyasso66
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

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

C++ for Beginners 2nd Edition Will Briggs


download

https://textbookfull.com/product/c20-for-lazy-programmers-quick-
easy-and-fun-c-for-beginners-2nd-edition-will-briggs/

Download more ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Primary Mathematics Textbook 2B Jennifer Hoerst

https://textbookfull.com/product/primary-mathematics-
textbook-2b-jennifer-hoerst/

Biota Grow 2C gather 2C cook Loucas

https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-
loucas/

Handbook of Macroeconomics, Volume 2A-2B SET 1st


Edition John B. Taylor

https://textbookfull.com/product/handbook-of-macroeconomics-
volume-2a-2b-set-1st-edition-john-b-taylor/

C 20 for Programmers 3rd Edition Harvey Deitel

https://textbookfull.com/product/c-20-for-programmers-3rd-
edition-harvey-deitel/
C# Programming for Absolute Beginners Radek Vystav■l

https://textbookfull.com/product/c-programming-for-absolute-
beginners-radek-vystavel/

Modern C for Absolute Beginners: A Friendly


Introduction to the C Programming Language 2nd Edition
Slobodan Dmitrovi■

https://textbookfull.com/product/modern-c-for-absolute-beginners-
a-friendly-introduction-to-the-c-programming-language-2nd-
edition-slobodan-dmitrovic/

C 7 0 Pocket Reference Instant Help for C 7 0


Programmers 1st Edition Joseph Albahari

https://textbookfull.com/product/c-7-0-pocket-reference-instant-
help-for-c-7-0-programmers-1st-edition-joseph-albahari/

Modern C for Absolute Beginners 1st Edition Slobodan


Dmitrovic

https://textbookfull.com/product/modern-c-for-absolute-
beginners-1st-edition-slobodan-dmitrovic/

Modern C for Absolute Beginners - Second Edition


Solbodan Dmitrovic

https://textbookfull.com/product/modern-c-for-absolute-beginners-
second-edition-solbodan-dmitrovic/
Will Briggs

C++20 for Lazy Programmers


Quick, Easy, and Fun C++ for Beginners
2nd ed.
Will Briggs
Lynchburg, VA, USA

Any source code or other supplementary material referenced by the


author in this book is available to readers on GitHub via the book’s
product page, located at www.​apress.​com/​9781484263051. For more
detailed information, please visit http://​www.​apress.​com/​source-code.

ISBN 978-1-4842-6305-1 e-ISBN 978-1-4842-6306-8


https://doi.org/10.1007/978-1-4842-6306-8

© Will Briggs 2021

This work is subject to copyright. All rights are reserved by the


Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

Distributed to the book trade worldwide by Apress Media, LLC, 1 New


York Plaza, New York, NY 10004, U.S.A. Phone 1-800-SPRINGER, fax
(201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit
www.springeronline.com. Apress Media, LLC is a California LLC and the
sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
To the learners and readers. They tell me what’s wrong, and what’s right.
Introduction
Surely there’s no shortage of C++ intro texts. Why write yet another?
I’m glad you asked.
Ever since moving from Pascal to C++ (back when dinosaurs
roamed the Earth), I’ve been underwhelmed by available resources. I
wanted something quirky and fun to read, with sufficient coverage and
fun examples, like the old Oh! Pascal! text by Cooper and Clancy. Even a
perfectly accurate text with broad coverage gives you nothing if you fall
asleep when you read it. Well, nothing but a sore neck.
But the other reason, of course, is to promote laziness.
We all want our projects to be done more quickly, with less wailing
and gnashing of teeth. Sometimes, it’s said, you have to put your nose to
the grindstone. Maybe, but I like my nose too well for that. I’d rather do
things the easy way.
But the easy way isn’t procrastinating and dragging my feet; it’s to
find something I love doing and do it well enough that it feels relatively
effortless. It’s producing something robust enough that when it does
break down, it tells me exactly what the problem is, so I don’t have to
spend a week pleading with it to explain itself. It’s writing code that I
can use again and again, adapting it to a new use in hours instead of
days.
Here’s what you can expect in this book:
A pleasant reading experience.
Adequate coverage.
Games, that is, use of the SDL (Simple DirectMedia Layer)
graphics library, which makes it easy to get graphics programs
working quickly. It isn’t fair that Python and Visual Basic should get
all the eye candy.1 The SDL library is used through Chapter 12. After
that, we’ll mostly use standard I/O, so we can get practice with the
more common console programs.
An easy introduction to SDL’s graphical magic, using the SSDL
(simple SDL) library (see below).
Sufficient examples—and they won’t all be about actuarial tables
or how to organize an address book. (See “A pleasant reading
experience” above.)
Antibugging sections throughout the text to point out common or
difficult-to-trace errors and how to prevent them.
For g++ programmers, instructions on using g++, the ddd/gdb
debugger system, and Makefiles; for Visual Studio, use of the
debugger and project files.
Compliance with C++20, the latest standard, and the goodies it
provides.
Hands-on experience with advanced data types like strings,
stacks, vectors, and lists – not by reading about them, but by building
them yourself.
An appreciation of laziness.
A cool title. Maybe I could have tried to write a “For Dummies”
book, but after seeing Bioinformatics for Dummies, I’m not sure I have
what it takes.

Why SDL?
It’s surely more enjoyable to make programs with graphics and WIMP2-
style interaction than to merely type things in and print them out.
There are a variety of graphical libraries out there. SDL , or Simple
DirectMedia Layer, is popular, relatively easy to learn, portable between
platforms, and fast enough for real-world work, as evidenced by its use
in actual released games.
Figure 1 A game of Freeciv, which uses the SDL library

Why SSDL?
…but although SDL is relatively easy, it’s not simple enough to start on
day 1 of programming with C++. SSDL – simple SDL – saves you from
needing to know things we don’t get to until Chapter 143 before doing
basic things like displaying images (Chapter 2) or even printing a
greeting (Chapter 1). It also hides the initialization and cleanup code
that’s pretty much the same every time you write a program and makes
error handling less cumbersome.
You may want to keep using SSDL as is after you’re done with this
book, but if you decide to go on with SDL, you’ll find you know a lot of it
already, with almost nothing to unlearn: most SSDL function names are
names from SDL with another “S” stuck on the front. We’ll go into
greater depth on moving forward with SDL in Chapter 29.
(Free) software you will need
At the time of writing, Microsoft Visual Studio (Community Edition) for
Windows is absolutely free, and g++ always is. So are the SSDL and
SDL2 libraries; Microsoft Core fonts for the Web , which you’ll need on
Unix systems; and the GIMP deluxe graphics editing package. See
Chapter 1 and Appendix A for help installing these essentials.
Programming with sound may not be practical over remote
connections because of the difficulty of streaming sound. If using Unix
emulation, you might check the emulator’s sound capabilities – say, by
playing a video.

If this is for a course…


C++20 for Lazy Programmers covers through pointers, operator
overloading, virtual functions, templates, exceptions, STL (Standard
Template Library), and everything you might reasonably expect in two
semesters of C++ – plus extras at the end.
The SSDL library does take a small amount of time, but the focus is
firmly on writing good C++ programs, with SSDL there just to make the
programs more enjoyable. How many labs or projects do you have in
which it’s hard to stop working because it’s so much fun? It may not
happen with all these problems, but I do see it happen.
SDL also gives a gentle introduction to event-driven programming.
In the first 12 chapters, there is emphasis on algorithm
development and programming style, including early introduction of
constants.
After Chapter 12, the examples are in standard I/O, though SSDL is
still an option for a few exercises and is used in Chapter 21 and (briefly)
Chapters 25 and 26.
A normal two-semester sequence should cover approximately the
following:
Semester 1: The first 12 chapters, using SSDL; Chapter 13,
introducing standard I/O. With some exceptions (& parameters,
stream I/O, constexpr), this looks a lot like C, and includes
variables, expressions, functions, control structures, arrays, and
stream I/O.
Semester 2: Chapters 14–22, using standard I/O, covering
pointers, dynamic memory, character arrays, classes, operator
overloading, templates, exceptions, virtual functions, multiple
inheritance (briefly), and a taste of the Standard Template Library
using vectors and linked lists.
Subsequent chapters cover material that wouldn’t easily fit in two
semesters, including more of the Standard Template Library, C
programming, and advanced topics including the use of command-line
arguments, bit manipulation, format strings, lambda functions, and
smart pointers.

Online help
Here are some sites to go to for more information, with URLs correct at
the time of writing:
SDL : www.libsdl.org . Click “Wiki.” You’ll find a reference for
SDL functions.
SDL’s helper libraries SDL_Image, SDL_Mixer, and SDL_TTF:
www.libsdl.org/projects/SDL_image/,
www.libsdl.org/projects/SDL_mixer/ , and
www.libsdl.org/projects/SDL_ttf/ . In each case, click
Documentation. You’ll find references for their functions. If the websites
have changed, doing a web search for the name of the library (e.g.,
SDL_Image) should get you there.

Legal stuff
Visual Basic, Visual Studio, Windows, Windows Vista, Excel, and
Microsoft are trademarks of the Microsoft Corporation. All other
trademarks referenced herein are property of their respective owners.
This book and its author are neither affiliated with nor authorized,
sponsored, or approved by the Microsoft Corporation.
Screenshots of Microsoft products are used with permission from
Microsoft.
Acknowledgments
Special thanks to
Dr. Kim McCabe, for advice on publishing.
Dr. Zakaria Kurdi, for the same.
Apress, especially Steve Anglin.
Microsoft.
The makers of GIMP (the GNU Image Manipulation Program).
Pixabay.com and contributors, especially 3D Animation Production
Company/QuinceCreative (Chapter 1, bullseye), David Mark/12019
(Chapter 2, beach), Free-Photos (Chapter 2, pug), Andi
Caswell/andicaz (Chapter 6, scones), joakant (Chapter 11, tropical
fish), Gerhard Janson/Janson_G (Chapter 12, UFO), 13smok (Chapter
12, alien sign), Prawny (Chapter 12, splat), Elliekha (Chapter 12,
haunted house), pencil parker (Chapter 12, candy), and Robert
Davis/rescueram3 (Chapter 12, pumpkin photos).
Wikimedia Commons.
OpenClipArt.org and contributors, especially Firkin (Chapter 2,
flamingo).
Flickr, especially Speedy McZoom (Chapter 12, jack-o’-lantern art).
FreeSound.org and contributors, especially Razor5 (Chapters 1 and 2,
techno music), robbo799 (Chapter 2, church bells), alqutis (Chapter
12, hover car), Berviceps (Chapter 12, splat), mistersherlock
(Chapter 12, Hallowe’en graveyard), matypresidente (Chapter 12,
water drop), Osiruswaltz (Chapter 12, bump), mrose6 (Chapter 12,
echoed scream), and robcro6010 (Chapter 12, circus theme).
Chad Savage of Sinister Fonts for Werewolf Moon (Chapter 12).
Lazy Foo’ Productions.
StackOverflow.com.
Einar Egilsson of cardgames.io for images of card games and Nicu
Buculei ( http://nicubunu.ro/cards ) for card images.
The alumni and colleagues who gave me reviews. You’re the best!
Table of Contents
Chapter 1:​Getting Started
Initial setup
…in Unix
…in MinGW
…in Microsoft Visual Studio
A simple program
Spacing
Creating an SSDL project
…with g++ (Unix or MinGW)
…in Microsoft Visual Studio
How not to be miserable (whatever your platform)
Shapes and the functions that draw them
consts and colors
Text
sout, escape sequences, and fonts
SSDL_​RenderText, SSDL_​RenderTextCenter​ed
Chapter 2:​Images and Sound
Images and window characteristics
Multiple images together
Adding transparency with GIMP
Sound
Chapter 3:​Numbers
Variables
Constants
When to use constants, not literal values
Math operators
Integer division
Assignment (=​) operators
A diving board example
The no-worries list for math operators
Built-in functions and casting
Chapter 4: Mouse, and if
Mouse functions
if
Coercion and if conditions (if’s dirty little secret)
Combining conditions with &​&​, ||, and !
Boolean values and variables
A hidden object game
Chapter 5: Loops, Input, and char
Keyboard input
while and do-while
Loops with SSDL
break and continue
for loops
Increment operators
An example:​Averaging numbers
chars and cctype
switch
Chapter 6:​Algorithms and the Development Process
Adventures in robotic cooking
Writing a program, from start to finish
Requirements:​What do we want to do?​
Algorithm:​How do we do it?​
Trace the algorithm:​Will it work?​
Coding:​Putting it all into C++ (plus:​commenting the lazy
way)
Chapter 7:​Functions
Functions that return values
Functions that return nothing
Global variables
How to write a function in four easy steps (and call it in one)
Why have functions, anyway?​
Recap
Chapter 8:​Functions, Continued
Random numbers
Making a random number generator
Using the built-in random number generator
Boolean functions
& parameters
Identifier scope
A final note on algorithms
Chapter 9:​Using the Debugger
Breakpoints and watched variables
ddd
gdb
Visual Studio
Fixing the stripes
Going into functions
ddd
gdb
Visual Studio
Fixing the stars
Wrap-up
Bottom-up testing
More on antibugging
Chapter 10: Arrays and enum
Arrays
Arrays’ dirty little secret:​using memory addresses
Arrays as function parameters
Array parameters that change, or don’t
Array parameters and reusability
Enumeration types
Multidimensional​arrays
Displaying the board
Arrays of more than two dimensions
Chapter 11:​Animation with structs and Sprites
structs
Making a movie with struct and while
Sprites
Chapter 12:​Making an Arcade Game:​Input, Collisions, and Putting
It All Together
Determining input states
Mouse
Keyboard
Events
Cooldowns and lifetimes
Collisions
The big game
Chapter 13:​Standard I/​O and File Operations
Standard I/​O programs
Compiling standard I/​O programs
Building a project from scratch (optional)
File I/​O (optional)
cin and cout as files
Using filenames
Chapter 14:​Character Arrays and Dynamic Memory
Character arrays
Dynamic allocation of arrays
Using the * notation
Chapter 15:​Classes
Constructors
const objects, const member functions…
…and const parameters
Multiple constructors
Copy constructors
Default constructors
Conversion constructors
Summary
Default parameters for code reuse
Date program (so far)
Chapter 16:​Classes, Continued
inline functions for efficiency
Access functions
Separate compilation and include files
What happens in separate compilation
Writing your .​h file
Backing up a multi-file project
Multiple-file projects in Microsoft Visual Studio
Multiple-file projects in g++
Command line:​more typing, less thinking
Makefiles:​more thinking, less typing (optional)
Final Date program
Chapter 17:​Operators
The basic string class
Destructors
Binary and unary operators:​=​=,​ !=​, and !
All other comparison operators at once
Assignment operators and *this
Arithmetic operators
[ ] and ( )
++ and --
>> and <<: operators that aren’t class members
static members
Explicit call to constructor
The final String program
#include <string>
Chapter 18:​Exceptions, Move Constructors and =​, Recursion, and O
notation
Exceptions
Move constructors and move =​(optional)
Recursion (optional; referenced in the next section)
Efficiency and O notation (optional)
Chapter 19:​Inheritance
The basics of inheritance
Constructors and destructors for inheritance and member
variables
Inheritance as a concept
Classes for card games
An inheritance hierarchy
private inheritance
Hiding an inherited member function
A game of Montana
Chapter 20:​Templates
Function templates
Concepts for function templates (optional)
The Vector class
Efficiency and O notation (optional)
Making Vector a template
Concepts for class templates (optional)
pair
Non-type template arguments
#include <vector>
Chapter 21:​Virtual Functions and Multiple Inheritance
Virtual functions, plus:​move functions with movable parents
and class members
Behind the scenes
Pure virtual functions and abstract base classes
Why virtual functions often mean using pointers
Virtual destructors
Move functions with movable parents and class members
(optional)
Multiple inheritance (optional)
Chapter 22:​Linked Lists
What lists are and why have them
Efficiency and O notation (optional)
Starting the linked list template
List<T>::List ( )
void List<T>::push_front (const T& newElement);
void List<T>::pop_front ( )
List<T>::~List ( )
->: a bit of syntactic sugar
More friendly syntax:​pointers as conditions
The linked list template
#include <list>
Chapter 23:​The Standard Template Library
Iterators
…with vector too
const and reverse iterators
Getting really lazy:​range-based for and auto
Spans
initializer_lists (optional)
<algorithm> (optional)
Chapter 24:​Building Bigger Projects
Namespaces
Conditional compilation
Libraries
g++
Microsoft Visual Studio
Chapter 25:​Esoterica (Recommended)
sstream: using strings like cin/cout
Formatted output with format strings
Command-line arguments
Debugging with command-line arguments in Unix
Debugging with command-line arguments in Visual Studio
Bit manipulation:​&​, |, ~, and <</​>>
Chapter 26:​Esoterica (Recommended), Continued
Defaulted constructors and =​
constexpr and static_assert: moving work to
compile time
Structured bindings and tuples:​returning multiple values at
once
Smart pointers
unique_ptr
shared_ptr
static_cast et al.
User-defined literals:​automatic conversion between systems of
measurement
Lambda functions for one-time use
Lambda captures
An example with lambda functions
Chapter 27:​Esoterica (Not So Recommended)
protected sections, protected inheritance
friends and why you shouldn’t have any
User-defined conversions (cast operators)
Modules
Coroutines
Chapter 28:​C
Compiling C
I/​O
printf
scanf and the address-of (&) operator
fprintf and fscanf, fopen and fclose
sprintf and sscanf; fgets, fputs, and puts
Summary of commands
Parameter passing with *
Dynamic memory
Chapter 29:​Moving on with SDL
Writing code
Compiling
Further resources
Appendix A:​Help with Setup
…for Unix users
Debian/​Ubuntu
RedHat/​Fedora
SSDL
…for MinGW users
…for Microsoft Visual Studio users
…for other platforms
Sound
Making your own projects
.​.​.​in g++
…in Microsoft Visual Studio
Appendix B:​Operators
Associativity
Precedence
Overloading
Appendix C:​ASCII Codes
Appendix D:​Fundamental Types
Appendix E:​Escape Sequences
Appendix F:​Basic C Standard Library
cmath
cctype
cstdlib
Appendix G:​Common Debugger Commands
Microsoft Visual Studio
gdb/ddd
Appendix H:​SSDL Reference
Updating the screen
Added types
Clearing the screen
Colors
Drawing
Images
Mouse, keyboard, and events
Music
Quit messages
Sounds
Sprites
Text
Time and synchronization
Window
References
Index
About the Author
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 pursuing research in
artificial intelligence.
About the Technical Reviewer
Charles A. Bell
conducts research in emerging
technologies. He is a principal software
developer of the Oracle MySQL
Development team. He lives in a small
town in rural Virginia with his loving
wife. He received his Doctor of
Philosophy in Engineering from Virginia
Commonwealth University in 2005.
Dr. Bell is an expert in the database
field and has extensive knowledge and
experience in software development and
systems engineering. His research
interests include microcontrollers, three-dimensional printing,
database systems, software engineering, and sensor networks. He
spends his limited free time as a practicing maker focusing on
microcontroller projects and refinement of three-dimensional printers.
Footnotes
1 “Eye candy”: things that look good on the screen. See The New Hacker’s Dictionary,
available at the time of writing at www.catb.org/jargon/ .

2 WIMP: window, icon, mouse, pointer. What we’re all used to.

3 Pointers.
© Will Briggs 2021
W. Briggs, C++20 for Lazy Programmers
https://doi.org/10.1007/978-1-4842-6306-8_1

1. Getting Started
Will Briggs1
(1) Lynchburg, VA, USA

Most programs in the first half of this book use the SDL and SSDL graphics-and-
games libraries,1 on the theory that watching colorful shapes move across the screen
and shoot each other is more interesting than printing text. Don’t worry. When you’re
done, you’ll be able to write programs both with and without this library – and if I
have anything to say about it, you’ll have had fun doing it.
If you’ve already chosen your platform, great. If not, here’s my recommendation:
If you just want to learn C++ on an easy and easily managed platform, Microsoft
Visual Studio is great.
If you are a Unix system administrator or have good access to one, and want to
use that popular and powerful platform, go for it.
To learn g++ and make – powerful tools from the Unix world – in Windows,
with a relatively easy setup, use MinGW.
The programming won’t differ much between platforms. But system setup can be
an issue.

Initial setup
First, you’ll need the source code for the textbook. You can access the code via the
Download Source Code button located at www.apress.com/9781484263051.
Then unzip it. In Unix, the unzip command should work; in Windows, you can
usually double-click it or right-click and choose Extract or Extract All.

…in Unix
Getting around in Unix isn’t in the scope of this book, but no worries. The basics of
copying files, moving files, and so on are easy to pick up.2
Unix system administration is way beyond the scope of this book.3 But installing
SSDL is easy. In that folder you just unzipped
Go into external/SSDL/unix, and type make. This builds SSDL in a place
where programs in the source code will know where to find it.
Go into ch1/test-setup.
cp Makefile.unix Makefile
make
./runx
You should see (and hear) the program illustrated in Figure 1-1. (If not,
something must be missing – please see Appendix A.) You might take a moment to try
another program from ch1, like 1-hello. Run it the same way you did test-
setup.

Figure 1-1 Output of test-setup

…in MinGW
You can find MinGW at sourceforge.net and other places. Try a web search on
“MinGW download.”
Once that’s installed, have it add the basics for C++; start the MinGW Installation
Manager (mingw-get.exe) and have it install, at least, mingw32-gcc-g++-bin,
mingw32-gdb-bin, and msys-make-bin.
You won’t need to install SDL or SSDL; they’re in the source code you unzipped.
So let’s try ‘em out. Open the Windows command prompt (click the Start Menu
and type cmd) and go to the source code’s ch1/test-setup folder. Here’s an easy
way: in the window for that folder, click the folder icon left of the address bar, the
part that shows something like ... > ch1 > test-setup. It’ll be replaced by a
highlighted path like the one in Figure 1-2. Press Ctrl-C to copy it.

Figure 1-2 Getting a path to use with the command prompt, in Windows

In the command window, enter the first two characters of that path you copied
(in my case, C:); then type cd, paste in the path (Ctrl-V), and press Enter again (see
Figure 1-3).

Figure 1-3 Getting to the right folder in the command prompt

Then

copy Makefile.mingW Makefile


make
Another Random Document on
Scribd Without Any Related Topics
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like