100% found this document useful (3 votes)
854 views

Download ebooks file Modern C for Absolute Beginners A Friendly Introduction to the C Programming Language Dmitrović Slobodan all chapters

Programming

Uploaded by

jessolyliawp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
854 views

Download ebooks file Modern C for Absolute Beginners A Friendly Introduction to the C Programming Language Dmitrović Slobodan all chapters

Programming

Uploaded by

jessolyliawp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Modern C for Absolute Beginners A Friendly


Introduction to the C Programming Language
Dmitrović Slobodan

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

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Modern C for Absolute Beginners A Friendly Introduction to


the C Programming Language Dmitrovi■ Slobodan

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

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/
textboxfull.com

Modern C++ for Absolute Beginners: A Friendly Introduction


to C++ Programming Language and C++11 to C++20 Standards
1st Edition Slobodan Dmitrovi■
https://textbookfull.com/product/modern-c-for-absolute-beginners-a-
friendly-introduction-to-c-programming-language-
and-c11-to-c20-standards-1st-edition-slobodan-dmitrovic/
textboxfull.com

Modern C for Absolute Beginners 1st Edition Slobodan


Dmitrovic

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

textboxfull.com
Modern C++ for Absolute Beginners 1st Edition Slobodan
Dmitrovi■ [Dmitrovi■

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

textboxfull.com

C# Programming for Absolute Beginners Radek Vystav■l

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

textboxfull.com

Modern C for Absolute Beginners - Second Edition Solbodan


Dmitrovic

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

textboxfull.com

Introduction to Google Analytics: A Guide for Absolute


Beginners Todd Kelsey

https://textbookfull.com/product/introduction-to-google-analytics-a-
guide-for-absolute-beginners-todd-kelsey/

textboxfull.com

Introduction to Search Engine Optimization: A Guide for


Absolute Beginners Todd Kelsey

https://textbookfull.com/product/introduction-to-search-engine-
optimization-a-guide-for-absolute-beginners-todd-kelsey/

textboxfull.com
Slobodan Dmitrović

Modern C for Absolute Beginners


A Friendly Introduction to the C Programming
Language
1st ed.
Slobodan Dmitrović
Belgrade, Serbia

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/​9781484266427. For more
detailed information, please visit http://​www.​apress.​com/​source-code.

ISBN 978-1-4842-6642-7 e-ISBN 978-1-4842-6643-4


https://doi.org/10.1007/978-1-4842-6643-4

© Slobodan Dmitrović 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.
For Sanja and Katarina
Acknowledgments
I would like to thank my friends and fellow peers who have supported
me in writing my second book.
I am forever indebted to Peter Dunne, Glenn Dufke, Bruce McGee,
Tim Crouse, Jens Fudge, Rainer Grimm, and Rob Machin for all their
work, help, and support.
I am grateful to the outstanding professionals at Apress who have
supported me during the entire writing process.
I am thankful to all of the amazing software developers, architects,
and entrepreneurs I met and collaborated with throughout the years.
Table of Contents
Part I: The C Programming Language
Chapter 1:​Introduction
1.​1 What Is C?​
1.​2 What Is C Used For?​
1.​3 C Compilers
1.​3.​1 Installing Compilers
1.​4 C Standards
Chapter 2:​Our First Program
2.​1 Function main()
2.​2 Comments
2.​3 Hello World
Chapter 3:​Types and Declarations
3.​1 Declarations
3.​2 Introduction
3.​3 Character Type
3.​4 Integer Type
3.​5 Floating-Point Types
3.​5.​1 float
3.​5.​2 double
3.​5.​3 long double
Chapter 4:​Exercises
4.​1 Hello World with Comments
4.​1.​1 Declaration
4.​1.​2 Definition
4.​1.​3 Outputting Values
Chapter 5:​Operators
5.​1 Introduction
5.​2 Arithmetic Operators
5.​3 Assignment Operator
5.​4 Compound Assignment Operators
5.​5 Relational Operators
5.​6 Equality Operators
5.​7 Logical Operators
5.​8 Increment and Decrement Operators
5.​9 Operator Precedence
Chapter 6:​Expressions
6.​1 Initialization
6.​2 Type Conversion
Chapter 7:​Statements
7.​1 Introduction
7.​2 Selection Statements
7.​2.​1 if
7.​2.​2 if-else
7.​2.​3 switch
7.​3 Iteration Statements
7.​3.​1 while
7.​3.​2 do-while
7.​3.​3 for
Chapter 8:​Exercises
8.​1 Arithmetic Operations
8.​2 Integral Division
8.​3 Floating-Point Division and Casting
8.​4 Equality Operator
8.​5 Relational and Logical Operators
8.​6 The switch Statement
8.​7 Iteration Statements
Chapter 9:​Arrays
9.​1 Declaration
9.​2 Subscript Operator
9.​3 Array Initialization
9.​4 Character Arrays
9.​5 Multidimensional​Arrays
9.​6 Array Size and Count
Chapter 10:​Pointers
10.​1 Introduction
10.​2 Declaration and Initialization
10.​3 Pointers and Arrays
10.​4 Pointer Arithmetics
10.​5 Void Pointers
10.​6 Pointer to Character Arrays
10.​7 Arrays of Pointers
Chapter 11:​Command-Line Arguments
Chapter 12:​Exercises
12.​1 Character Array
12.​2 Array Elements
12.​3 Pointer to an Existing Object
12.​4 Pointers and Arrays
12.​5 Pointer to a Character Array
12.​6 Pointer Arithmetics
12.​7 Array of Pointers
Chapter 13:​Functions
13.​1 Introduction
13.​2 Function Declaration
13.​3 Function Definition
13.​4 Parameters and Arguments
13.​4.​1 Passing Arguments
13.​5 Return Statement
Chapter 14:​Exercises
14.​1 A Simple Function
14.​2 Function Declaration and Definition
14.​3 Passing Arguments by Value
14.​4 Passing Arguments by Pointer/​Address
14.​5 Function – Multiple Parameters
Chapter 15:​Structures
15.​1 Introduction
15.​2 Initialization
15.​3 Member Access Operator
15.​4 Copying Structures
15.​5 Pointers to Structures
15.​6 Self-Referencing Structures
15.​7 Structures as Function Arguments
Chapter 16:​Unions
Chapter 17:​Conditional Expression
Chapter 18:​Typedef
Chapter 19:​Const Qualifier
Chapter 20:​Enumerations
Chapter 21:​Function Pointers
Chapter 22:​Exercises
22.​1 Structure Definition
22.​2 Structure Typedef Alias
22.​3 Structure Initialization
22.​4 Pointers to Structures
22.​5 Unions
22.​6 Const Variables and Pointers
22.​7 Constant Function Parameters
22.​8 Enums
22.​9 Pointers to Functions
Chapter 23:​Preprocessor
23.​1 #include
23.​2 #define
23.​3 #undef
23.​4 Conditional Compilation
23.​4.​1 #if
23.​4.​2 #ifdef
23.​4.​3 #ifndef
23.​5 Built-in Macros
23.​6 Function-Like Macros
Chapter 24:​Exercises
24.​1 Define and Undefine a Macro
24.​2 Conditional Compilation
24.​3 Built-in Macros
24.​4 Function Macros
Chapter 25:​Dynamic Memory Allocation
25.​1 malloc
25.​2 calloc
25.​3 realloc
Chapter 26:​Storage and Scope
26.​1 Scope
26.​1.​1 Local Scope
26.​1.​2 Global Scope
26.​2 Storage
26.​2.​1 Automatic Storage Duration
26.​2.​2 Static Storage Duration
26.​2.​3 Allocated Storage Duration
Chapter 27:​Exercises
27.​1 Dynamic Memory Allocation
27.​2 Dynamic Memory Allocation:​Arrays
27.​3 Dynamic Memory Resizing
27.​4 Automatic and Allocated Storage
Chapter 28:​Standard Input and Output
28.​1 Standard Input
28.​1.​1 scanf
28.​1.​2 sscanf
28.​1.​3 fgets
28.​2 Standard Output
28.​2.​1 printf
28.​2.​2 puts
28.​2.​3 fputs
28.​2.​4 putchar
Chapter 29:​File Input and Output
29.​1 File Input
29.​2 File Output
Chapter 30:​Exercises
30.​1 Standard Input
30.​2 Standard Output
Chapter 31:​Header and Source Files
Part II: The C Standard Library
Chapter 32:​Introduction to C Standard Library
32.​1 String Manipulation
32.​1.​1 strlen
32.​1.​2 strcmp
32.​1.​3 strcat
32.​1.​4 strcpy
32.​1.​5 strstr
32.​2 Memory Manipulation Functions
32.​2.​1 memset
32.​2.​2 memcpy
32.​2.​3 memcmp
32.​2.​4 memchr
32.​3 Mathematical Functions
32.​3.​1 abs
32.​3.​2 fabs
32.​3.​3 pow
32.​3.​4 round
32.​3.​5 sqrt
32.​4 String Conversion Functions
32.​4.​1 strtol
32.​4.​2 snprintf
Part III: Modern C Standards
Chapter 33:​Introduction to C11 Standard
33.​1 _​Static_​assert
33.​2 The _​Noreturn Function Specifier
33.​3 Type Generic Macros Using _​Generic
33.​4 The _​Alignof Operator
33.​5 The _​Alignas Specifier
33.​6 Anonymous Structures and Unions
33.​7 Aligned Memory Allocation:​aligned_​alloc
33.​8 Unicode Support for UTF-16 and UTF-32
33.​9 Bounds Checking and Threads Overview
33.​9.​1 Bounds-Checking Functions
33.​9.​2 Threads Support
Chapter 34:​The C17 Standard
Chapter 35:​The Upcoming C2X Standard
35.​1 _​Static_​assert Without a Message
35.​2 Attributes
35.​3 No Parameters Function Declaration
35.​4 The strdup Function
35.​5 The memccpy Function
Part IV: Dos and Don’ts
Chapter 36:​Do Not Use the gets Function
Chapter 37:​Initialize Variables Before Using Them
Chapter 38:​Do Not Read Out of Bounds
Chapter 39:​Do Not Free the Allocated Memory Twice
Chapter 40:​Do Not Cast the Result of malloc
Chapter 41:​Do Not Overflow a Signed Integer
Chapter 42:​Cast a Pointer to void* When Printing Through printf
Chapter 43:​Do Not Divide by Zero
Chapter 44:​Where to Use Pointers?​
44.​1 Pointers to Existing Objects
44.​2 Pointers to Arrays
44.​3 Pointers to String Constants
44.​4 Pointers to Dynamically Allocated Memory
44.​5 Pointers as Function Arguments
Chapter 45:​Prefer Functions to Function-Like Macros
Chapter 46:​static Global Names
Chapter 47:​What to Put in Header Files?​
47.​1 Shared Macros
47.​2 Function Declarations
47.​3 Shared extern Variables and Constants
47.​4 Other Header Files
Part V: Appendices
Appendix A:​Linkage
Appendix B:​Time and Date
Appendix C:​Bitwise Operators
C.​1 The Bitwise NOT Operator ~
C.​2 Bitwise Shift Operators << and >>
C.​3 The Bitwise AND Operator &​
Appendix D:​Numeric Limits
D.​1 Integer Types Limits
D.​2 Floating-Point Types Limits
Appendix E:​Summary and Advice
E.​1 What to Learn Next?​
E.​2 Online References
E.​3 Other C Books
E.​4 Advice
Index
About the Author
Slobodan Dmitrović
is a software consultant, trainer, and
entrepreneur. He is the founder and CEO
of “Clear Programming Paradigm,” an
LLC that provides outsourcing and
training services. Slobodan’s ability to
summarize complex topics and provide
insightful training made him a sought-
after consultant for automotive, fintech,
and other industries. He has a strong
interest in C, C++, software architecture,
training, and R&D. Slobodan can be
reached at www.cppandfriends.com
.
About the Technical Reviewer
German Gonzalez-Morris
is a software architect/engineer working with C/C++, Java, and
different application containers, in particular, with WebLogic Server. He
has developed different applications including JEE/Spring/Python. His
areas also include OOP, Java/JEE, Python, design patterns, algorithms,
Spring Core/MVC/Security, and microservices. German has worked in
performance messaging, Restful API, and transactional systems. For
more, see www.linkedin.com/in/german-gonzalez-morris .
Part I
The C Programming Language
© Slobodan Dmitrović 2021
S. Dmitrović, Modern C for Absolute Beginners
https://doi.org/10.1007/978-1-4842-6643-4_1

1. Introduction
Slobodan Dmitrović 1
(1) Belgrade, Serbia

Dear reader, congratulations on choosing to learn the C programming


language, and thank you for picking up this book. My name is Slobodan
Dmitrović, and I will try to introduce you to a wonderful world of C
programming to the best of my abilities. This book is divided into four
parts. In Part 1, we cover the C language basics. Part 2 explains the C
standard library, and Part 3 introduces us to modern C standards. The
final part explains the dos and don’ts in modern C. Let us get started!

1.1 What Is C?
C is a programming language, a general-purpose, procedural, compiled
programming language. C language was created by Dennis Ritchie in
the late 1960s and early 1970s. The C program is a collection of C
source code spread across one or more source and header files. Source
files by convention have the .c extension, and header files have the .h
extension. Source and header files are plain text files that contain some
C code.

1.2 What Is C Used For?


C is often used for so-called systems programming, which is operating
systems programming, application programming, and embedded
systems programming, to name a few. A large portion of Linux and
Windows operating systems was programmed using C. C is often used
as a replacement for an assembly language. C language constructs
efficiently translate to the hardware itself. Whenever we want to get
down to the metal, we can opt for C.

1.3 C Compilers
To compile and run a C program, we need a C compiler. A compiler
compiles a C program and turns the source code into an object file. The
linker then links the object files together and produces an executable
file or a library, depending on our intention. For the most part, we say
we compile the program and assume the compilation process results in
an executable file that we can run. At the time of writing, some of the
more popular C compilers are:
gcc – as part of the GCC toolchain
Clang – as part of the LLVM toolchain
Visual C/C++ compiler – as part of the Visual Studio IDE
MinGW – a Windows port of the GCC

1.3.1 Installing Compilers


Here we describe how to install C compilers on Linux and Windows and
how to compile and run our programs.

1.3.1.1 On Linux
To install a GCC compiler on Linux , open a terminal window and type:

sudo apt install build-essential

This command installs a GCC toolchain, which we can use to


compile, debug, and run our C programs. Using a text editor of our
choice, let us create a file with the following code:

#include <stdio.h>

int main(void)
{
printf("Hello World!\n");
}
Let us save the file as a source.c. To compile this program using GCC,
we type:

gcc source.c

This will produce an executable file with a default name of a.out. To


run this file, type the following in a console window:

./a.out

Running this program should output the Hello World! string in


our console window.

Note For now, let us take the source code inside the source.c file for
granted. The example is for demonstration purposes. We will get into
detailed code explanation and analysis in later chapters.

To install a clang compiler on our Linux system, type:

sudo apt install clang

This command installs another compiler called Clang, which we can


also use to compile our programs. To compile our previous program
using a clang compiler, we type:

clang source.c

Same as before, the compiler compiles the source file and produces
an executable file with the default name of a.out. To run this file, we
type:

./a.out

The compiler choice is a matter of preference. Just substitute gcc


with clang and vice versa. To compile with warnings enabled, type:

gcc -Wall source.c


Warnings are not errors. They are messages indicating that
something in our program might lead to errors. We want to eliminate or
minimize the warnings as well.
To produce a custom executable name, add the -o flag, followed by
the custom executable name, so that our compilation string now looks
like:

gcc -Wall source.c -o myexe

To run the executable file, we now type:

./myexe

The ISO C standard governs the C programming language. There are


different versions of the C standard. We can target a specific C standard
by adding the -std= flag, followed by a standard name such as c99,
c11, or c17. To compile for a c99 standard, for example, we would
write:

gcc -std=c99 -Wall source.c

To compile for a C11 standard, we use:

gcc -std=c11 -Wall source.c

If we want to adhere to strict C standard rules, we add the -


pedantic compilation flag. This flag issues warnings if our code does
not comply with the strict C standard rules. Some of the use cases are:

gcc -std=c99 -Wall -pedantic source.c


gcc -std=c11 -Wall -pedantic source.c
gcc -std=c17 -Wall -pedantic source.c
gcc -std=c2x -Wall -pedantic source.c

To compile and run the program using a single statement, we type:

gcc source.c && ./a.out


This statement compiles the program and, if the compilation
succeeds, executes the a.out file.
Let us put it now all together and use the following compilation
strings in our future projects. If using gcc:

gcc -Wall -std=c11 -pedantic source.c && ./a.out

If using Clang:

clang -Wall -std=c11 -pedantic source.c && ./a.out

1.3.1.2 On Windows
On Windows , we can install Visual Studio. Choose the Create a new
project option, make sure the C++ option is selected, choose Empty
Project, and click Next. Modify the project and solution names or leave
the default values, and click Create. We have now created an empty
Visual Studio project. In the Solution Explorer window, right-click on a
project name and choose Add – New Item…. Ensure the Visual C++ tab is
selected, click on the C++ File (.cpp) option, modify the file name to
source.c, and click Add. We can use a different file name, but the
extension should be .c. Double-click on the source.c file, and paste our
previous Hello World source code into it. Press F5 to run the program.
To compile for the C11 standard, use the /std:c11 compiler switch.
To compile for the C17 standard, use the /std:c17 compiler switch.
Alternatively, install the MinGW (Minimalist GNU for Windows) and
use the compiler in a console window, the same way we would on
Linux.
So far, we have learned how to set up the programming
environments on Linux and Windows and compile and run our C
programs. We are now ready to start with the C theory and examples.

1.4 C Standards
The C programming language is a standardized language. There were
different C standards throughout history. The first notable standard
was the ANSI C, and now it is the ISO standard known as the
ISO/IEC:9989 standard. Some of the C standards throughout the years:
ANSI C Standard (referred to as ANSI C and C89)
C90 (official name: ISO/IEC 9899:1990; it is the ANSI C Standard
adopted by ISO; the C89 and C90 are the same things)
C99 (ISO/IEC 9899:1999)
C11 (ISO/IEC 9899:2011)
C17 (ISO/IEC 9899:2018)
The upcoming standard informally named C2x
Each of the standards introduces new features and changes to the
language and the standard library. Everything starting with C11 is often
referred to as the modern C. And modern C is what we will be teaching
in this book. Let us get started!
© Slobodan Dmitrović 2021
S. Dmitrović, Modern C for Absolute Beginners
https://doi.org/10.1007/978-1-4842-6643-4_2

2. Our First Program


Slobodan Dmitrović 1
(1) Belgrade, Serbia

This section describes the main program entry point, how to work with
comments, and how to write a simple “Hello World” program.

2.1 Function main()


Every C program that produces an executable file must have a starting
point. This starting point is the function main. The function main is the
function that gets called when we start our executable file. It is the
program’s main entry point. The signature of the function main is:

int main(void) {}

The function main is of type int, which stands for integer, followed
by the reserved name main, followed by an empty list of parameters
inside the parentheses (void). The name void inside the
parentheses means the function accepts no parameters. Following is
the function body marked with braces {}. The opening brace { marks
the beginning of a code block, and the closing brace } marks the end of
the code block. We write our C code inside the code block marked by
these braces. The code we write there executes when we start our
executable file.
For readability reasons, we can put braces on new lines:

int main(void)
{

}
We can keep the opening brace on the same line with the main
function definition and have the ending brace on a new line:

int main(void) {

Note Braces placement position is a matter of conventions,


preferences, and coding styles.

In early C standards, the function main was required to have a return


0; statement. This statement ends the program and returns control to
the operating system. The return value of 0 means the program
finished the execution as expected. It ended normally. If the main
function returns any value other than 0, it means the program ended
unexpectedly. So, in previous standards, our blank program would look
like:

int main(void)
{
return 0;
}

Statements in C end with a semicolon (;). The return 0;


statement within the main function is no longer required in modern C.
We can omit that statement. When the program execution reaches the
closing brace, the effect is the same as if we explicitly wrote the
statement. In modern standards, we can simply write:

int main(void)
{

}
We often see the use of the following, also valid main signature:

int main()
{
return 0;
}

While this signature indicates there are no parameters, in ANSI C, it


could potentially allow us to call the function with any number of
parameters. Since we want to avoid that, we will be using the int
main(void) signature, which explicitly states the function does not
accept parameters.
With that in mind, we will be using the following main skeleton to
write our code throughout the book:

int main(void)
{

Note There is another main signature accepting two parameters:


int main(int argc, char* argv[]). We will describe it
later in the book when we learn about arrays, pointers, and
character arrays.

2.2 Comments
We can have comments in our C program. A comment is a text that is
useful to us but is ignored by the compiler. Comments are used to
document the source code, serve as notes, or comment-out the part of
the source code.
A C-style comment starts with /* characters and ends with */
characters. The comment text is placed between these characters.
Example:

int main(void)
{
/* This is a comment in C */
}
The comment can also be a multiline comment:

int main(void)
{
/* This is a
multi-line comment in C */
}

Starting with C99, we can write a single-line comment that starts


with a double slash // followed by a comment text:

int main(void)
{
// This is a comment
}

We can have multiple single-line comments on separate lines:

int main(void)
{
// This is a comment
// This is another comment
}

Comments starting with the double slash // are also referred to as


C++ style comments.

2.3 Hello World


Let us write a simple program that outputs a “Hello World” message in
the console window and explain what each line of code does. The full
listing is:

#include <stdio.h>
Random documents with unrelated
content Scribd suggests to you:
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law in
the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name
associated with the work. You can easily comply with the terms of
this agreement by keeping this work in the same format with its
attached full Project Gutenberg™ License when you share it without
charge with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the terms
of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project 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