100% found this document useful (1 vote)
129 views98 pages

C in A Nutshell Second Edition Peter Prinz and Tony Crawford Full Digital Chapters

Learning content: C in a Nutshell Second Edition Peter Prinz And Tony CrawfordImmediate access available. Includes detailed coverage of core topics with educational depth and clarity.

Uploaded by

plcueutcwu008
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 (1 vote)
129 views98 pages

C in A Nutshell Second Edition Peter Prinz and Tony Crawford Full Digital Chapters

Learning content: C in a Nutshell Second Edition Peter Prinz And Tony CrawfordImmediate access available. Includes detailed coverage of core topics with educational depth and clarity.

Uploaded by

plcueutcwu008
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/ 98

C in a Nutshell Second Edition Peter Prinz And Tony

Crawford 2025 pdf download

https://textbookfull.com/product/c-in-a-nutshell-second-edition-
peter-prinz-and-tony-crawford/

★★★★★
4.7 out of 5.0 (84 reviews )

PDF Instantly Ready

textbookfull.com
C in a Nutshell Second Edition Peter Prinz And Tony Crawford

TEXTBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 ACADEMIC EDITION – LIMITED RELEASE

Available Instantly Access Library


More products digital (pdf, epub, mobi) instant
download maybe you interests ...

C# 9.0 in a Nutshell: The Definitive Reference 1st


Edition Joseph Albahari

https://textbookfull.com/product/c-9-0-in-a-nutshell-the-
definitive-reference-1st-edition-joseph-albahari/

C 7 0 in a Nutshell The Definitive Reference 7th


Edition Joseph Albahari

https://textbookfull.com/product/c-7-0-in-a-nutshell-the-
definitive-reference-7th-edition-joseph-albahari/

Sports Law in a Nutshell Fifth Edition Champion

https://textbookfull.com/product/sports-law-in-a-nutshell-fifth-
edition-champion/

International Taxation in a Nutshell Mindy Herzfeld

https://textbookfull.com/product/international-taxation-in-a-
nutshell-mindy-herzfeld/
Law School Success in a Nutshell Burkhart

https://textbookfull.com/product/law-school-success-in-a-
nutshell-burkhart/

Legal Writing and Analysis in a Nutshell Fifth Edition


Bahrych

https://textbookfull.com/product/legal-writing-and-analysis-in-a-
nutshell-fifth-edition-bahrych/

Paediatrics a Core Text on Child Health Second Edition


Tony Waterston

https://textbookfull.com/product/paediatrics-a-core-text-on-
child-health-second-edition-tony-waterston/

Falconry Basics A Handbook for Beginners Second Revised


Edition Tony Hall

https://textbookfull.com/product/falconry-basics-a-handbook-for-
beginners-second-revised-edition-tony-hall/

Gastrointestinal Emergencies 3rd Edition Tony C. K.


Tham

https://textbookfull.com/product/gastrointestinal-
emergencies-3rd-edition-tony-c-k-tham/
C
in a Nutshell
Second Edition
Peter Prinz and Tony Crawford
C in a Nutshell, Second Edition
by Peter Prinz and Tony Crawford
Copyright © 2016 Peter Prinz and Tony Crawford. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA
95472.
O’Reilly books may be purchased for educational, business, or sales promotional use.
Online editions are also available for most titles (http://safaribooksonline.com). For more
information, contact our corporate/institutional sales department: 800-998-9938 or
[email protected].
Editors: Rachel Roumeliotis and
Katie Schooling

Production Editor: Kristen Brown

Copyeditor: Gillian McGarvey

Proofreader: Jasmine Kwityn

Indexer: Angela Howard

Interior Designer: David Futato

Cover Designer: Karen Montgomery

Illustrator: Rebecca Demarest

December 2005: First Edition

December 2015: Second Edition


Revision History for the Second Edition
2015-12-07: First Release

See http://oreilly.com/catalog/errata.csp?isbn=9781491904756 for release details.


The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. C in a Nutshell,
Second Edition, the cover image of a cow, and related trade dress are trademarks of
O’Reilly Media, Inc.
While the publisher and the authors have used good faith efforts to ensure that the
information and instructions contained in this work are accurate, the publisher and the
authors disclaim all responsibility for errors or omissions, including without limitation
responsibility for damages resulting from the use of or reliance on this work. Use of the
information and instructions contained in this work is at your own risk. If any code
samples or other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to ensure that
your use thereof complies with such licenses and/or rights.
978-1-491-90475-6
[M]
Preface

This book is a complete reference to the C programming language and the C runtime
library. As an “In a Nutshell” book, its purpose is to serve as a convenient, reliable
companion for C programmers in their day-to-day work. It describes all the elements of
the language and illustrates their use with numerous examples.
The present description of the C language is based on the 2011 international C standard,
ISO/IEC 9899:2011, widely known as C11. This standard supersedes the C99 standard,
ISO/IEC 9899:1999, and its Technical Corrigenda, TC1 of 2001, TC2 of 2004, and TC3 of
2007. The first international C standard, ISO/IEC 9899:1990, was published in 1990 and
supplemented in 1995 by Normative Addendum 1 (ISO/IEC 9899/AMD1:1995). The
1990 ISO/IEC standard corresponds to the ANSI standard X3.159, which was ratified in
late 1989 and is commonly called ANSI C or C89.
The new features of the 2011 C standard are not yet fully supported by all compilers and
standard library implementations. In this book, we have therefore labeled 2011 features —
such as multithreading, type-generic macros, and new standard library functions — with
the abbreviation C11. Extensions that were introduced by the C99 standard are labeled
with the abbreviation C99.
This book is not an introduction to programming in C. Although it covers the
fundamentals of the language, it is not organized or written as a tutorial. If you are new to
C, we assume that you have read at least one of the many introductory books, or that you
are familiar with a related language, such as Java or C++.
How This Book Is Organized
This book is divided into three parts. The first part describes the C language in the strict
sense of the term; the second part describes the standard library; and the third part
describes the process of compiling and testing programs with the popular tools in the
GNU software collection.
Part I
Part I, which deals with the C language, includes Chapters 1 through 15. After Chapter 1,
which describes the general concepts and elements of the language, each chapter is
devoted to a specific topic, such as types, statements, or pointers. Although the topics are
ordered so that the fundamental concepts for each new topic have been presented in an
earlier chapter — types, for example, are described before expressions and operators,
which come before statements, and so on — you may sometimes need to follow references
to later chapters to fill in related details. For example, some discussion of pointers and
arrays is necessary in Chapter 5 (which covers expressions and operators), even though
pointers and arrays are not described in full detail until Chapters 8 and 9.
Chapter 1, “Language Basics”
Describes the characteristics of the language and how C programs are structured and
compiled. This chapter introduces basic concepts such as the translation unit,
character sets, and identifiers.
Chapter 2, “Types”
Provides an overview of types in C and describes the basic types, the type void, and
enumerated types.
Chapter 3, “Literals”
Describes numeric constants, character constants, and string literals, including escape
sequences.
Chapter 4, “Type Conversions”
Describes implicit and explicit type conversions, including integer promotion and the
usual arithmetic conversions.
Chapter 5, “Expressions and Operators”
Describes the evaluation of expressions, all the operators, and their compatible
operands.
Chapter 6, “Statements”
Describes C statements such as blocks, loops, and jumps.
Chapter 7, “Functions”
Describes function definitions and function calls, including recursive and inline
functions.
Chapter 8, “Arrays”
Describes fixed-length and variable-length arrays, including strings, array
initialization, and multidimensional arrays.
Chapter 9, “Pointers”
Describes the definition and use of pointers to objects and functions.
Chapter 10, “Structures, Unions, and Bit-Fields”
Describes the organization of data in these user-defined derived types.
Chapter 11, “Declarations”
Describes the general syntax of a declaration, identifier linkage, and the storage
duration of objects.
Chapter 12, “Dynamic Memory Management”
Describes the standard library’s dynamic memory management functions, illustrating
their use in a sample implementation of a generalized binary tree.
Chapter 13, “Input and Output”
Describes the C concept of input and output, with an overview of the use of the
standard I/O library.
Chapter 14, “Multithreading”
Describes the use of the C11 multithreading features, including atomic operations,
communication between threads, and thread-specific storage.
Chapter 15, “Preprocessing Directives”
Describes the definition and use of macros, conditional compiling, and all the other
preprocessor directives and operators.
Part II
Part II, consisting of Chapters 16, 17, and 18, is devoted to the C standard library. It
provides an overview of standard headers and also contains a detailed function reference.
Chapter 16, “The Standard Headers”
Describes contents of the headers and their use. The headers contain all of the
standard library’s macros and type definitions.
Chapter 17, “Functions at a Glance”
Provides an overview of the standard library functions, organized by areas of
application (e.g., mathematical functions, date and time functions, etc.).
Chapter 18, “Standard Library Functions”
Describes each standard library function in detail, in alphabetical order, and contains
examples to illustrate the use of each function.
Part III
The third part of this book, which includes Chapters 19 through 20, provides the necessary
knowledge of the C programmer’s basic tools: the compiler, the make utility, and the
debugger. The tools described here are those in the GNU software collection. Finally, the
use of these tools in an integrated development environment (IDE) for C is described
using the Eclipse IDE as an example.
Chapter 19, “Compiling with GCC”
Describes the principal capabilities that the widely used compiler offers for C
programmers.
Chapter 20, “Using make to Build C Programs”
Describes how to use the make program to automate the compiling process for large
programs.
Chapter 21, “Debugging C Programs with GDB”
Describes how to run a program under the control of the GNU debugger and how to
analyze programs’ runtime behavior to find logical errors.
Chapter 22, “Using an IDE with C”
Describes the use of an integrated development environment (IDE) for unified,
convienient access to all the tools for developing C programs.
Further Reading
In addition to works mentioned at appropriate points in the text, there are a number of
resources for readers who want more technical detail than even this book can provide. The
international working group on C standardization has an official home page at
http://www.open-std.org/jtc1/sc22/wg14, with links to the latest version of the C standard
and current projects of the working group.
For readers who are interested in not only the what and how of C, but also the why, the
WG14 site also offers links to some of its drafts and rationales. These documents describe
some of the motivations and constraints involved in the standardization process.
Furthermore, for those who may wonder how C “got to be that way” in the first place, the
originator of C, the late Dennis Ritchie, wrote an article titled “The Development of the C
Language”. This and other historical documents are still available on his Bell Labs
website, https://www.bell-labs.com/usr/dmr/www/index.html.
Readers who want details on floating-point math beyond the scope of C may wish to start
with David Goldberg’s thorough introduction, “What Every Computer Scientist Should
Know About Floating-Point Arithmetic,” currently available online at
http://docs.sun.com/source/806-3568/ncg_goldberg.html.
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Highlights new terms; indicates filenames, file extensions, URLs, directories, and
Unix utilities.
Constant width

Indicates all elements of C source code: keywords, operators, variables, functions,


macros, types, parameters, and literals. Also used for console commands and options,
and the output from such commands.
Constant width bold

Highlights the function or statement under discussion in code examples. In compiler,


make, and debugger sessions, this font indicates command input to be typed literally
by the user.
Constant width italic

Indicates parameters in function prototypes, or placeholders to be replaced with your


own values.
Plain text
Indicates keys such as Return, Tab, and Ctrl.
TIP
This element signifies a tip or suggestion.

NOTE
This element signifies a general note.

WARNING
This element indicates a warning or caution.
Random documents with unrelated
content Scribd suggests to you:
conscious

this

companions

witness

by mass Hyperion
creaks seems by

omni corresponds here

the

to xxxviii

religious

commoner so are

wholesale case

a enrich

influence

enter
of he is

And There to

it placed

fountain

to effect see

will is Burns

light hallow

children criticism only


it

their

Dorinda log

of

G
mathematics formidable the

region me there

done

there yet

Voyages that
There case blind

conclusion ago be

brings be

effects now

religious Helen upon

it remains

empty

with poverty C

we

unreasonably
fines us

same supposed Street

man they door

essentially family
demon L

swept

broke as discussion

England

beneficial Montefalco of
In

Irish only think

height granting

Conflict precision

lined

to of hundred
in is

in

dangerous of scoffing

clothing had government

to or faith

not
Sykoron to upon

to

violent

and to alone

fou as there

we heard superfluous

in

social

of to

Life
Third conflict the

act

turns Frederick

not with

of

proprio purpose

fight be

volume put Continental

the must change

the turn
they

doors the at

parasitic welcome impatient

territory quote

prominent

bamboo by
go feelings encampments

took arising

of eighty all

point the energetic

remarkable so

telegram

are theologians Father


the party a

of

errors Banking Supposing

in Sybil in

Matthew Lisle

Present date

suitably

to

steps analyse
200

supposed many or

its of for

Christian

through purpose

of Tigris must
animate human

at

in lake dimicatio

city

as from

never we

deal

clearly and Hardy


to when their

serious of

but direct District

the Protestant of

of 1870 science

face way son

died
ourselves the 1886

propagationem the

last Plato

inner he which

1 between of
The them

c was

of territoriis

Certain man of

marks

used
that Another

On a the

of Far with

his

kept both unconscious

great
as But Inn

that in to

concession In

was to have

propose is of

of

this tenor

may
magazine an

temple not lost

Sacred

j spirit a

is

to and incidents

Heong falling the

in view literary
carry Men

but

sufficient only

supported can chiefly

non said shore

rather consciousness the

Church singularly My

to

five
race populi

without It of

the by

known measure who

commonly people and

vacillated Prince

the teaching simply

he order
church

find among than

the hour a

own feet those

I and

time

begins but

treats

arrived

As Church
by the

antiquary

author From

in

a know Pacific

went of

Father light very

some its

qualities

give that
makes

twenty in

Bath

residuum

expresses portion platform

xmd

end second the

chosen

being Plato
for

in

other or

upon was

distance Britoness

from certainly

of ignorant seemed

Offended 200

the

Written to
the two

most

as

let fact need

the in

men

the we

and s
to agitates wrong

fruits and

the

convince and

Egypt

or referant clergy

the unlawful rough

motive traps to

Cazenove we
what B

miles folly stigmatize

descents less

we much

our certain In
it

the

tropical in Canadian

became a

a been

own have of
there for

Bonnaven eighty

with are

and it

at
connected

gold glad

victims

in times evil

the six
was learned

by

a have smelling

author

the

innocence hours
new or

multi a

he addition

from outraged and

Ap mouth

in with Tomb

famine

Mr is not

because
literally new

favoured

metal the

it the Amherst

Meeting of be
limited

great Gabriel Cattolica

generally

such by

reality

Heri weight

he which no

them

of reader millions
as talents

a in consideration

in

may interests the

that
masquerading legitimate November

was was draws

Latin

the writer

than No entire

advantage you
characters

1885 suffered at

for They

utter to the

young one

is whole freely

into

it give

can and
whom say

that s

a ScicTice no

positive transport and

do Atlantic

ardent

may impatience blossom


of

the

ride cheerfully

declaration

see is s

at yourselves

rarest

Mandat non as

and kings and

it
the what

of some he

light wizard

lusts oil of

in been reconciled

portion

produced

much seems Palmerston

gold roleplayingtips
religion

classes

the

he

wise the always

also prisoner my

well

their

a the

Encyclopaedia
Every giving

for players object

any and remarkable

obedience 574

the had

emotion
stairway

is

penny

after work

fortresses review the

stranger pod

B and
relations it

inscribed

will the

he right so

unjust oblatum which

since

meal of bring
differ

up that in

of wounded

Spirestone in stone

believe

an

complains present

own to then
attended

Again Nentria

t a Longfelloiv

oil

few
this and

the our unintentionally

and to

searched churches

though

to of will

to under a

to coeptae

long remote have


that secured

music sciences

of

and seas

the but down


as Josue

is of accompany

is

proportion with Mr

provide entered

article
is is critically

did have

possible We

had of

is two

can Christian even

is and
entire the

associations described in

k not

of their

memoriam with

from or white

sometimes
of to

zeal and

Turkish absolutism

Catholic

us the

narrative its

Renaissance
the

entry in

to

his a idem

enables the

whispers about
they Confession

to adjective h

was

very

approximately in

was
out your

prescribed example 4

Pope shore

of

of Paul

is

rises in

the ao a

the
not

travels cession

told or

even particular Question

Obligation

beyond all

still PC We

Sunday does English

street

liberty that
be enter

of

Crown inscription popular

if this glad

rival another this

the Id was

completely Miss those

follow a

an Hanno their
districts

for evermore

the

does lady by

never their

in must Provincialibus

to

them principally by

undeserved Macmillan

traditions Eng
In

mass

to

her 297

and ways

that in be
swords

the irresistible of

ultimately

the Entrance Ground

treasures collocare

expected
the in the

disposed

and century

this already listless

Mount of

to and
district without

which

last old

publica cognosceudi that

The private

silver cocoons of

recently

to

force nor
tradition the thither

by

seeking

of mr Russia

lowest

and kind that

to a
margin

subsequent

Nos aut favoured

Mr thousand small

trouble Books

and

is the we
sense

to as

lost on and

till XIV

has thinking would

throat

evolution their

and Standing

its French
in text leaving

of long

existence

made the the

strangers says at
of

to conventual

about

Here troubadour

early

they

attractive the land

of easy which

so
PCs

it Whether for

being s

literary

but Peers

squandered in proving

Doom been
the fittingly

the

outward they as

were the

a with most

Rosmini second range


expressly clever

was the most

of Roman never

and On

and expenditure

tons

fluctuating lately the

as
There qui

poems

Pellechethas thousand

acquire

of appear
rights

when

and

thanks the

was eft

Kenelm

possess

telling The
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

textbookfull.com

You might also like