CART

(0) items

C Programming Language

by ;
Edition:
2nd
ISBN13:

9780131103627

ISBN10:
0131103628
Format:
Paperback
Pub. Date:
3/22/1988
Publisher(s):
Prentice Hall
Includes 2-weeks free access to
step-by-step solutions for this book.
Step-by-Step solutions are actual worked out problems to the questions at the end of each chapter that help you understand your homework and study for your exams. Chegg and eCampus are providing you two weeks absolutely free. 81% of students said using Step-by-Step solutions prepared them for their exams.
List Price: $67.00

Rent Textbook

(Recommended)
 
Term
Due
Price
$33.50

Buy Used Textbook

Usually Ships in 2-3 Business Days
U9780131103627
$48.36

Buy New Textbook

Currently Available, Usually Ships in 24-48 Hours
N9780131103627
$64.65

eTextbook


 
Duration
Price
$40.20
More New and Used
from Private Sellers
Starting at $23.00
See Prices

Questions About This Book?

Why should I rent this book?
Renting is easy, fast, and cheap! Renting from eCampus.com can save you hundreds of dollars compared to the cost of new or used books each semester. At the end of the semester, simply ship the book back to us with a free UPS shipping label! No need to worry about selling it back.
How do rental returns work?
Returning books is as easy as possible. As your rental due date approaches, we will email you several courtesy reminders. When you are ready to return, you can print a free UPS shipping label from our website at any time. Then, just return the book to your UPS driver or any staffed UPS location. You can even use the same box we shipped it in!
What version or edition is this?
This is the 2nd edition with a publication date of 3/22/1988.
What is included with this book?
  • The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any CDs, lab manuals, study guides, etc.
  • The Used copy of this book is not guaranteed to inclue any supplemental materials. Typically, only the book itself is included.
  • The Rental copy of this book is not guaranteed to include any supplemental materials. You may receive a brand new copy, but typically, only the book itself.

Related Products


  • C Answer Book Bk. C : The C Programming Language
    C Answer Book Bk. C : The C Programming Language




Summary

The authors present the complete guide to ANSI standard C language programming. Written by the developers of C, this new version helps readers keep up with the finalized ANSI standard for C while showing how to take advantage of C's rich set of operators, economy of expression, improved control flow, and data structures. The 2/E has been completely rewritten with additional examples and problem sets to clarify the implementation of difficult language constructs. For years, C programmers have let K&R guide them to building well-structured and efficient programs. Now this same help is available to those working with ANSI compilers. Includes detailed coverage of the C language plus the official C language reference manual for at-a-glance help with syntax notation, declarations, ANSI changes, scope rules, and the list goes on and on.

Author Biography

Brian W. Kernighan works in the Computing Science Research Center at Bell Laboratories, Lucent Technologies. He is Consulting Editor for Addison-Wesley's Professional Computing Series and the author, with Dennis Ritchie, of The C Programming Language.

 

Dennis Ritchie was a computer scientist notable for his influence on ALTRAN, B, BCPL, C, Multics, and Unix.

 

 

 

Table of Contents

Preface ix(2)
Preface to the First Edition xi
Introduction 1(4)
Chapter 1. A Tutorial Introduction
5(30)
1.1 Getting Started
5(3)
1.2 Variables and Arithmetic Expressions
8(5)
1.3 The For Statement
13(1)
1.4 Symbolic Constants
14(1)
1.5 Character Input and Output
15(7)
1.6 Arrays
22(2)
1.7 Functions
24(3)
1.8 Arguments--Call by Value
27(1)
1.9 Character Arrays
28(3)
1.10 External Variables and Scope
31(4)
Chapter 2. Types, Operators, and Expressions
35(20)
2.1 Variable Names
35(1)
2.2 Data Types and Sizes
36(1)
2.3 Constants
37(3)
2.4 Declarations
40(1)
2.5 Arithmetic Operators
41(1)
2.6 Relational and Logical Operators
41(1)
2.7 Type Conversions
42(4)
2.8 Increment and Decrement Operators
46(2)
2.9 Bitwise Operators
48(2)
2.10 Assignment Operators and Expressions
50(1)
2.11 Conditional Expressions
51(1)
2.12 Precedence and Order of Evaluation
52(3)
Chapter 3. Control Flow
55(12)
3.1 Statements and Blocks
55(1)
3.2 If-Else
55(2)
3.3 Else-If
57(1)
3.4 Switch
58(2)
3.5 Loops--While and For
60(3)
3.6 Loops--Do-while
63(1)
3.7 Break and Continue
64(1)
3.8 Goto and Labels
65(2)
Chapter 4. Functions and Program Structure
67(26)
4.1 Basics of Functions
67(4)
4.2 Functions Returning Non-integers
71(2)
4.3 External Variables
73(7)
4.4 Scope Rules
80(1)
4.5 Header Files
81(2)
4.6 Static Variables
83(1)
4.7 Register Variables
83(1)
4.8 Block Structure
84(1)
4.9 Initialization
85(1)
4.10 Recursion
86(2)
4.11 The C Preprocessor
88(5)
Chapter 5. Pointers and Arrays
93(34)
5.1 Pointers and Addresses
93(2)
5.2 Pointers and Function Arguments
95(2)
5.3 Pointers and Arrays
97(3)
5.4 Address Arithmetic
100(4)
5.5 Character Pointers and Functions
104(3)
5.6 Pointer Arrays; Pointers to Pointers
107(3)
5.7 Multi-dimensional Arrays
110(3)
5.8 Initialization of Pointer Arrays
113(1)
5.9 Pointers vs. Multi-dimensional Arrays
113(1)
5.10 Command-line Arguments
114(4)
5.11 Pointers to Functions
118(4)
5.12 Complicated Declarations
122(5)
Chapter 6. Structures
127(24)
6.1 Basics of Structures
127(2)
6.2 Structures and Functions
129(3)
6.3 Arrays of Structures
132(4)
6.4 Pointers to Structures
136(3)
6.5 Self-referential Structures
139(4)
6.6 Table Lookup
143(3)
6.7 Typedef
146(1)
6.8 Unions
147(2)
6.9 Bit-fields
149(2)
Chapter 7. Input and Output
151(18)
7.1 Standard Input and Output
151(2)
7.2 Formatted Output--Printf
153(2)
7.3 Variable-length Argument Lists
155(2)
7.4 Formatted Input -- Scanf
157(3)
7.5 File Access
160(3)
7.6 Error Handling--Stderr and Exit
163(1)
7.7 Line Input and Output
164(2)
7.8 Miscellaneous Functions
166(3)
Chapter 8. The UNIX System Interface
169(22)
8.1 File Descriptors
169(1)
8.2 Low Level I/O -- Read and Write
170(2)
8.3 Open, Creat, Close, Unlink
172(2)
8.4 Random Access -- Lseek
174(1)
8.5 Example--An Implementation of Fopen and Getc
175(4)
8.6 Example--Listing Directories
179(6)
8.7 Example--A Storage Allocator
185(6)
Appendix A. Reference Manual
191(50)
A1 Introduction
191(1)
A2 Lexical Conventions
191(3)
A3 Syntax Notation
194(1)
A4 Meaning of Identifiers
195(2)
A5 Objects and Lvalues
197(1)
A6 Conversions
197(3)
A7 Expressions
200(10)
A8 Declarations
210(12)
A9 Statements
222(3)
A10 External Declarations
225(2)
A11 Scope and Linkage
227(1)
A12 Preprocessing
228(6)
A13 Grammar
234(7)
Appendix B. Standard Library
241(18)
B1 Input and Output: [stdio.h]
241(7)
B2 Character Class Tests: [ctype.h]
248(1)
B3 String Functions: [string.h]
249(1)
B4 Mathematical Functions: [math.h]
250(1)
B5 Utility Functions: [stdlib.h]
251(2)
B6 Diagnostics: [assert.h]
253(1)
B7 Variable Argument Lists: [stdarg.h]
254(1)
B8 Non-local Jumps: [setjmp.h]
254(1)
B9 Signals: [signal.h]
255(1)
B10 Date and Time Functions: [time.h]
255(2)
B11 Implementation-defined Limits: [limits.h] and [float.h]
257(2)
Appendix C. Summary of Changes
259(4)
Index 263

Excerpts

Preface The computing world has undergone a revolution since the publication of The C Programming Languagein 1978. Big computers are much bigger, and personal computers have capabilities that rival the mainframes of a decade ago. During this time, C has changed too, although only modestly, and it has spread far beyond its origins as the language of the UNIX operating system. The growing popularity of C, the changes in the language over the years, and the creation of compilers by groups not involved in its design, combined to demonstrate a need for a more precise and more contemporary definition of the language than the First edition of this book provided. In 1983, the American National Standards Institute (ANSI) established a committee whose goal was to produce "an unambiguous and machine-independent definition of the language C," while still retaining its spirit. The result is the ANSI standard for C. The standard formalizes constructions that were hinted at but not described in the first edition, particularly structure assignment and enumerations. It provides a new form of function declaration that permits cross-checking of defini-tion with use. It specifies a standard library, with an extensive set of functions for performing input and output, memory management, string manipulation, and similar tasks. It makes precise the behavior of features that were not spelled out in the original definition, and at the same time states explicitly which aspects of the language remain machine-dependent. This second edition of The C Programming Languagedescribes C as defined by the ANSI standard. Although we have noted the places where the language has evolved, we have chosen to write exclusively in the new form. For the most part, this makes no significant difference; the most visible change is the new form of function declaration and definition. Modern compilers already support most features of the standard. We have tried to retain the brevity of the first edition. C is not a big language, and it is not well served by a big book. We have improved the exposition of critical features, such as pointers, that are central to C programming. We have refined the original examples, and have added new examples in several chapters. For instance, the treatment of complicated declarations is augmented by programs that convert declarations into words and vice versa. As before, all examples have been tested directly from the text, which is in machine-readable form. Appendix A, the reference manual, is not the standard, but our attempt to convey the essentials of the standard in a smaller space. It is meant for easy comprehension by programmers, but not as a definition for compiler writersN that role properly belongs to the standard itself. Appendix B is a summary of the facilities of the standard library. It too is meant for reference by programmers, not implementers. Appendix C is a concise summary of the changes from the original version. As we said in the preface to the first edition, C "wears well as one''s experience with it grows." With a decade more experience, we still feel that way. We hope that this book will help you to learn C and to use it well. Brian W. Kernighan, Dennis M. Ritchie Preface to the First Edition C is a general-purpose programming language which features economy of expression, modern control flow and data structures, and a rich set of operators. C is not a "very high level" language, nor a "big" one, and is not specialized to any particular area of application. But its absence of restrictions and its generality make it more convenient and effective for many tasks than supposedly more powerful languages. C was originally designed for and implemented on the UNIX operating sys-tem on the DEC PDP-1 1, by Dennis Ritchie. The operating system, the C compiler, and essentially all UNIX applications programs (including all of the software used to prepare this book) are written in C. Production compilers also exist for several other machines, including the IBM System/370, the Honeywell 6000, and the Interdata 8/32. C is not tied to any particular hardware or system, however, and it is easy to write programs that will run without change on any machine that supports C. This book is meant to help the reader learn how to program in C. It contains a tutorial introduction to get new users started as soon as possible, separate chapters on each major feature, and a reference manual. Most of the treatment is based on reading, writing and revising examples, rather than on mere statements of rules. For the most part, the examples are complete, real programs, rather than isolated fragments. All examples have been tested directly from the text, which is in machine-readable form. Besides showing how to make effective use of the language, we have also tried where possible to illustrate useful algorithms and principles of good style and sound design. The book is not an introductory programming manual; it assumes some familiarity with basic programming concepts like variables, assignment statements, loops, and functions. Nonetheless, a novice programmer should be able to read along and pick up the language, although access to a more knowledgeable colleague will help. In our experience, C has proven to be a pleasant, expressive, and versatile language for a wide variety of programs. It is easy to learn, and it wears well as one''s experience with it grows. We hope that this book will help you to use it well. Brian W. Kernighan, Dennis M. Ritchie


Please wait while the item is added to your cart...