Sold Out
Book Categories |
Preface
I. Basics
1. What Is C?
How Programming Works
Brief History of C
How C Works
How to Learn C
2. Basics of Program Writing
Programs from Conception to Execution
Creating a Real Program
Creating a Program Using a Command-Line Compiler
Creating a Program Using an Integrated Development Environment
Getting Help on UNIX
Getting Help in an Integrated Development Environment
IDE Cookbooks
Programming Exercises
3. Style
Common Coding Practices
Coding Religion
Indentation and Code Format
Clarity
Simplicity
Summary
4. Basic Declarations and Expressions
Elements of a Program
Basic Program Structure
Simple Expressions
Variables and Storage
Variable Declarations
Integers
Assignment Statements
printf Function
Floating Point
Floating Point Versus Integer Divide
Characters
Answers
Programming Exercises
5. Arrays, Qualifiers, and Reading Numbers
Arrays
Strings
Reading Strings
Multidimensional Arrays
Reading Numbers
Initializing Variables
Types of Integers
Types of Floats
Constant Declarations
Hexadecimal and Octal Constants
Operators for Performing Shortcuts
Side Effects
++x or x++
More Side-Effect Problems
Answers
Programming Exercises
6. Decision and Control Statements
if Statement
else Statement
How Not to Use strcmp
Looping Statements
while Statement
break Statement
continue Statement
Assignment Anywhere Side Effect
Answer
Programming Exercises
7. Programming Process
Setting Up
Specification
Code Design
Prototype
Makefile
Testing
Debugging
Maintenance
Revisions
Electronic Archaeology
Marking Up the Program
Using the Debugger
Text Editor as a Browser
Add Comments
Programming Exercises
II. Simple Programming
8. More Control Statements
for Statement
switch Statement
switch, break, and continue
Answers
Programming Exercises
9. Variable Scope and Functions
Scope and Class
Functions
Functions with No Parameters
Structured Programming
Recursion
Answers
Programming Exercises
10. C Preprocessor
#define Statement
Conditional Compilation
include Files
Parameterized Macros
Advanced Features
Summary
Answers
Programming Exercises
11. Bit Operations
Bit Operators
The and Operator (&)
Bitwise or (|)
The Bitwise Exclusive or (^)
The Ones Complement Operator (Not) (~)
The Left- and Right-Shift Operators (<<, >>)
Setting, Clearing, and Testing Bits
Bitmapped Graphics
Answers
Programming Exercises
12. Advanced Types
Structures
Unions
typedef
enum Type
Casting
Bit Fields or Packed Structures
Arrays of Structures
Summary
Programming Exercises
13. Simple Pointers
Pointers as Function Arguments
const Pointers
Pointers and Arrays
How Not to Use Pointers
Using Pointers to Split a String
Pointers and Structures
Command-Line Arguments
Programming Exercises
Answers
14. File Input/Output
Conversion Routines
Binary and ASCII Files
The End-of-Line Puzzle
Binary I/O
Buffering Problems
Unbuffered I/O
Designing File Formats
Answers
Programming Exercises
15. Debugging and Optimization
Debugging
Interactive Debuggers
Debugging a Binary Search
Runtime Errors
The Confessional Method of Debugging
Optimization
Answers
Programming Exercises
16. Floating Point
Floating-Point Format
Floating Addition/Subtraction
Multiplication
Division
Overflow and Underflow
Roundoff Error
Accuracy
Minimizing Roundoff Error
Determining Accuracy
Precision and Speed
Power Series
Programming Exercises
III. Advanced Programming Concepts
17. Advanced Pointers
Pointers and Structures
free Function
Linked List
Structure Pointer Operator
Ordered Linked Lists
Double-Linked Lists
Trees
Printing a Tree
Rest of Program
Data Structures for a Chess Program
Answers
Programming Exercises
18. Modular Programming
Modules
Public and Private
The extern Modifier
Headers
The Body of the Module
A Program to Use Infinite Arrays
The Makefile for Multiple Files
Using the Infinite Array
Dividing a Task into Modules
Module Division Example: Text Editor
Compiler
Spreadsheet
Module Design Guidelines
Programming Exercises
19. Ancient Compilers
K&R-Style Functions
Library Changes
Missing Features
Free/Malloc Changes
lint
Answers
20. Portability Problems
Modularity
Word Size
Byte Order Problem
Alignment Problem
NULL Pointer Problem
Filename Problems
File Types
Summary
Answers
21. C's Dustier Corners
do/while
goto
The ?: Construct
The , Operator
volatile Qualifier
Answer
22. Putting It All Together
Requirements
Specification
Code Design
Coding
Functional Description
Expandability
Testing
Revisions
A Final Warning
Program Files
Programming Exercises
23. Programming Adages
General
Design
Declarations
switch Statement
Preprocessor
Style
Compiling
Final Note
Answer
IV. Other Language Features
A. ASCII Table
B. Ranges and Parameter Passing Conversions
C. Operator Precedence Rules
D. A Program to Compute a Sine Using a Power Series
Glossary
Symbols and Numbers[ Top ]
& (address of operator), 185
& (and operator), 158, 185
& vs. &&, 159
* operator (dereference), 185
!= operator (not equal), 85
^ (exclusive or), 158, 161
, operator (comma), 85, 346
{} (curly braces), 85
" (double quote), 60
-- operator (decrement), 78
= versus ==, 10, 91
== operator (equal), 85, 105, 382
<< (left shift), 158, 162
> operator (greater than), 85
-> operator (structure pointer), 287
>= operator (greater than or equal to), 85
>> (right shift), 158, 162
++ operator (increment), 78
+= operator (increase), 79
' (single quotes), 60
~ (complement operator), 158, 161
| (or operator), 158, 160
[_IX-1_]
0 character, 64
A[ Top ]
abstract class, 356
accuracy, floating point, 269, 270
addition operator (+), 51
addition, floating point, 266
address of operator (&), 185
alignment restrictions, 339
ambiguous code, 86
and operator (&), 158
and portability, 338
argc, 201
argv, 201
array declarations, 7
arrays, 63, 181
dimension of, 63
elements of, 63
index, 64
infinite, 310, 313, 316
initializing, 73
multi-dimensional, 74
and pointers, 189, 191
of structures, 181
ASCII
characters, 60
files, 215-216
assembly language, 5
assignment statements, 8, 382
author, 40
auto, 130
automatic parameter changes, 194
automatic variables, 130
B[ Top ]
binary
files, 215-216, 338
I/O, 218
mode for fopen (b), 216
trees, 292
bit fields, 179, 181
bit operations, 156
bit operators, 158
bitmapped graphics, 166, 167
bits, 54, 156, 163-164
bitwise and (&), 158
bitwise complement (~), 158, 161
bitwise exclusive or (^), 158, 161
bitwise left shift (<<), 158
bitwise or (|), 158, 160
bitwise right shift (>>), 158, 162
bitwise shift left (<<), 162
blank modifier, 306
boolean algebra, 156
bottom-up programming, 136
Bourne shell, 142
branching statements, 84
break statement, 89, 118, 121
breakpoints, 253
buffered file problems, 219
bytes, 156, 338
C[ Top ]
%c conversion, 60
C language, 6
C tools, 107
C++ language, 7, 9
Calc (program), 98, 100, 120
calculation operators, 51
call graphs, 108
carriage return, 216
case labels, 119
case statement, 118-119
cb program, 108
cc command, 140, 144, 148
cd command, 97
cdb debugger, 240
cflow program, 108
char, 60
character type, 354
characters, 60
as integers, 76
chess, data structures for, 300
classes, ii, 129
abstract, 356
derived, 356
pure virtual functions, 356
variable, 127
clearing bits, 163
close, 222
COBOL, 6
code
coding, 355
commenting out, 148
design, 96, 98, 349
format, 45, 48
maintaining, 38
source, 11
command-line arguments, 201
commands, 240
comments, 9, 39, 148
author, 40
boxes, 40, 43
in data files, 225
file formats, 42
functions, 130
heading, 40, 42, 50
notes, 42
procedures, 130
program, 109
purpose, 40
references, 42
restrictions, 42
revision history, 42
units, 44
compile command, 148
compilers, 7, 14, 324
conditional, 146
complement (~), 158, 161
complex data types, 7
computation operators, 51
concatenating strings, 66
conditional clause, 84
conditionals, 382
const statement, 77, 145
const pointers, 189
continue statement, 90, 123
control flow, 84
control statements, 8
control variables, 116
conversion routines, 212
cpp program, 144
cprint printer, 108
CR (carriage return), 216
cross-reference programs, 107
ctype.h, 296
curly braces, 85
and arrays, 73
D[ Top ]
%d conversion, 56
data declarations, 7, 49
data types, enumerated, 178
dbx debugger, 240
-DDEBUG, 238
debug statement, 147
debugging, 9, 38, 97, 104, 264
binary search, 244
breakpoints, 253
with cdb, 240
command-line switch, 238
conditional compilation, 238
with dbx, 240
divide and conquer method, 237
interactive, 240
going through output, 239
save file, 232
with sdb, 240
decimal point, 57
decision statements, ii
declarations, 42, 49
array, 7
data, 7
integer, 54
pointer, 184
structures, 7
variable, 52, 53
default statement, 118, 383
#define statement, 140-141
vs. const, 145
defining bit values, 163
dereference operator (*), 185
derived class, 356
diagnostic printf, 105
dimensions, array, 63
directories, 97
divide by 0 error, 254
divide operator (/), 51, 58
division, floating point, 268
do/while statement, 344
documents, government, 4
DOS Makefile, 316
double data type, 271, 272
double-linked list, 288, 290
double quotes, 60, 65
dynamic data structures, 279
E[ Top ]
elements, 63, 173
else statement, 85, 147
Emacs editor, 43
#endif statement, 147
English language, 4
enum (enumerated) data types, 178
EOF (end of file) character, 210
escape character, 60
Evaluation order problems, 79
EVEN macro, 160
exclusive or (^), 158, 161
executable program, 11
executable statements, 51
extern, 306, 308
F[ Top ]
%f conversion, 77
factorial (program), 137
far pointers, 184
fclose, 210
fflush, 219, 255
fgetc, 210
fgets, 211
newline problem, 69
standard function, 67
Fibonacci (program), 87
fields, 173
bit, 179, 181
files, 209, 227
ASCII, 215, 216
binary, 215, 216, 338
closing, 210
FILE, 209
formats, 42, 224, 226
header, 308
naming, 209, 341
opening, 209
source, 8, 11
types, 342
variables, 209
float data type, 272
float.h include file, 272
floating point, 77, 265
accuracy, 269, 270
addition, 266
declaration, 58
division, 58, 268
floating point (continued)
exception, 254
float.h, 272
guard digit, 266
multiplication, 267
numbers, 57, 60
overflow, 268
precision, 272
roundoff error, 269, 270
speed, 272
subtraction, 266
underflow, 268, 269
fopen, 209, 210
for statement, 115, 116
FORTRAN, 6, 116
fprintf, 212
fputc, 211
fputs, 211, 212
fread, 218
free, 282
fscanf, 213
FTP, obtaining exercises via, vii
FTPMAIL, vii
FTPMAIL, obtaining exercises via, vii
functions, ii, 130
library, 51
standard, 8
fwrite, 218
G[ Top ]
-g (compiler option), 14
generic pointer, 281
global variables, 127
government documents, 4
graphics, bitmapped, 166
grind printer, 108
guard digit, floating point, 266
H[ Top ]
header files, 308
heading comments, 42, 50
hello (program), 39
helmet law, 4
help, 33
hexadecimal numbers, 78, 157
high-level languages, 6
histogram program, 316
I[ Top ]
if statement, 84
#ifdef statement, 147, 148
#ifndef statement, 147
include file, float.h, 272
include files, 148
#include statement, 148, 308
indentation, 45
indent program, 108
tools for, 107
indexes (and arrays), 64
infinite arrays, 305, 310, 313, 316
initializing
multi-dimensional arrays, 74
strings, 74
structures, 175
variables, 73, 74
instructions, 8
integer
declarations, 54
division, 58
long data type, 75
overflow, 61
types, 75, 77
unsigned, 75
very short (char), 76
interactive debugging, 240
isalpha, 296
K[ Top ]
Kernigham, Brian, 6
L[ Top ]
%L conversion, 77
labels, goto, 345
languages, 4-7
law, helmet, 4
learning C++, 9
left shift (<<), 158, 162
lex utility, 325
lexical analysis, 325
LF (line feed), 216
%lf conversion, 77
libraries, 8
library functions, 51
library, standard, 11
limit error, 61
line feed, 216
linear programs, 84
lines, in coding, 51
linked lists, 283, 310
add element, 284
locate element, 286
linker, 11
list command (dbx), 241
local
header files, 308
include files, 149
variables, 127
long data type, 75, 76
long double integers, 77
portability and, 338
looping statements, 8, 84, 87
M[ Top ]
machine language, 5
macros
definitions, 152
and parameters, 150
replacement, 142
magic numbers, 226
main, 50
maintaining code/programs, 38, 97
make, 101, 313
targets, 314
with multiple files, 313
Makefile, 101, 313
DOS, 316
malloc, 281
man pages (UNIX), 33
math operators, 51
mechanics of programming, ii
memory, 7
memset, 260, 261, 317
min macro, 346
minimizing roundoff error, 270
mistakes, 10
mkdir command, 97
modifying code, 38
modularity, 337
modules, 304-305, 322, 324
MS-DOS, 216
_ _MSDOS_ _ (pre-defined symbol), 148
multi-dimensional arrays, 70, 74
multiple files, 304, 313
multiplication, floating point, 267
multiply and shifting, 162
multiply operator (*), 51
N[ Top ]
n (newline character), 60
near pointers, 184
nested
ifs, 47
include files, 149
new lines, 69
newline character (n), 60
next command (dbx), 240
node, tree, 292
normal int and portability, 338
NUL character, 64
null pointers, 341
O[ Top ]
O_ flags, 221
object file, 11, 14
octal numbers, 78
ones complement (~), 161
open mode, 220, 221
operations, cost of, 262
operators, bitwise, 158
optimization, 256, 262
integer versus floating-point, 263
loop ordering, 257, 261
macros, 261
powers of 2, 258
reduction in strength, 262
register variables, 257
or opeator (|), 158, 160
ordered linked lists, 287
organization, program, 8
Oualline's law of documentation, 40
output redirection, 239
overflow, 61, 268
P[ Top ]
packed structures, 179, 181
pad characters, 340
parameterized macros, 150
parameters, passing, 188
parsing, 325
PASCAL, 6, 116
case statement, 119
passing parameters, 188
permanent variables, 127, 129
pixels, 166
pointers, ii
alignment errors, 281
and arrays, 189, 191
const, 189
declaring, 184
far, 184
freeing, 283
generic, 281
near, 184
and structures, 200, 201, 279, 282
portability, 337
alignment restrictions, 339
byte order and, 338
word size and, 338
power series, 272
#pragma statement, 152
precision, floating point, 272
pre-defined symbols, 148
preliminary specification, 98
preprocessor, 140
abuse, 142
#define, 141
#else, 147
#endif, 147
hash mark and, 141
hidden errors, 143
#ifdef, 147
#ifndef, 147
#include, 148
running, 144
#undef, 147
print command (dbx), 240
print_file (program), 202
printers, pretty, 108
printf, 51, 56, 57, 212
floating points and, 61
string variables and, 66
printing a tree, 296
private modules, 305
programming
mechanics of, ii
styles of, ii, 136
programs, 8, 11
basic structure, 50, 51
life cycle of, 95
organization, 8
porting, 337
revising, 97
specification, 95, 98
testing, 358
pseudocode, 98
public modules, 305
pure virtual functions, 356
R[ Top ]
read function, 222
reading strings, 67
real division, 58
real numbers, 57
recursion, 136, 294
redirection, output, 239
references, 42
register variables, 257
relational operators, 85
requirements, 348
reserved words, 52
return code, main, 50
revisions, history, 42
revisions, program, 97, 107
right shift (>>), 158, 162
Ritchie, Dennis, 6
root, tree, 292
roundoff error, floating point, 269-270
run command (dbx), 240
runtime errors, 254
divide by 0 error, 254
floating-point exception, 254
Segmentation Violation, 254
stack overflow, 254
S[ Top ]
%s format (printf), 66
save files, 232
scanf, 71, 213
scope, variable, 127
sdb debugger, 240
search, tree, 293
Segmentation Violation, 254
setting bits, 163
shampoo, 4
shift left (<<), 158, 162
shift right (>>), 158, 162
shifting and multipling, 162
short data type, 76
portability and, 338
shorthand operators, 79
side effects, 79
sine, computing, 273
single quotes, 60
sizeof, 212
source code, 11
source file, 8, 11
special characters, 60
specification, 348
program, 95, 98
speed, floating point, 272
splitting a string, 197
spotting mistakes, 10
spreadsheets, 325
sprintf, 212
sscanf, 71, 213
stack overflow error, 129, 254
standard
files, 210, 221
functions, 8
include files, 148
library, 11
statements
assignment, 8
control, 8
decisions, ii
for, 116
grouping, 85
looping, 8
while, 116
static modifier, 129, 306
status variable, 210
stderr, 210
stdin, 210
stdio.h, 148, 209
stdout, 210
step command (dbx), 240
stop command (dbx), 240
_ _STDC _ (pre-defined symbol), 148
strcat, 66
strcmp, 66, 86
strcpy, 65, 66
strings, 64
concatenating, 66
functions, 66
initializing, 74
newline problem, 69
reading, 67
splitting, 197
variable length, 65
strlen, 66, 68
Stroustrup, Bjarne, 7
struct, 173
structured programming, 135
structures, ii, 173, 181
declarations, 7
initializing, 175
initializing an array of, 181
packed, 179, 181
pointer operator (->), 287
and pointers, 200, 201
unpacked, 178
style, programming, ii
subtraction operator (-), 51
subtraction, floating point, 266
sun, temperature, 274
Sun-3/50, 272
switch statement, 118, 124
symbol tables, 292
T[ Top ]
Teletype Model 33, 216
tempeture, sun, 274
temporary variables, 127, 129
testing
bits, 163
programs, 97, 358
text editor, 11
tokens, 351
top-down programming, 136
translation, assembly language, 5
trees, 292
printing, 296
truncation, 58
_ _TURBOC _ (pre-defined symbol), 148
typedef statement, 177, 178
U[ Top ]
unbuffered I/O, 220
#undef statement, 147
underflow, floating point, 268
uninitialized variable, 55
unions, ii, 175
units, program, 44
unpacked structure, 178
unsigned numbers, 75, 76
upgrading, 38
V[ Top ]
variable-length strings, 65
variables, ii
class, 127, 129
declarations, 7
declaring, 42, 44, 53
global, 127
initializing, 73, 74
local, 127
naming, 42, 44, 52, 383
permanent, 127, 129
scope, 127
temporary, 127, 129
type, 52
uninitialized, 55
version numbers, 226
very short int (char), 76
vi editor, 43
void *, 281
W[ Top ]
where command (dbx), 241
while statement, 87, 116
wildcard characters, 202
word size and portability, 338
write function, 222
Y[ Top ]
yacc utility, 325
Z[ Top ]
zero-based counting, 116
Login|Complaints|Blog|Games|Digital Media|Souls|Obituary|Contact Us|FAQ
CAN'T FIND WHAT YOU'RE LOOKING FOR? CLICK HERE!!! X
You must be logged in to add to WishlistX
This item is in your Wish ListX
This item is in your CollectionPractical C Programming, Third Edition
X
This Item is in Your InventoryPractical C Programming, Third Edition
X
You must be logged in to review the productsX
X
X
Add Practical C Programming, Third Edition, There are lots of introductory C books, but this is the first one that has the no-nonsense, practical approach that has made Nutshell Handbooks(R) famous. C programming is more than just getting the syntax right. Style and debugging also play a tremen, Practical C Programming, Third Edition to the inventory that you are selling on WonderClubX
X
Add Practical C Programming, Third Edition, There are lots of introductory C books, but this is the first one that has the no-nonsense, practical approach that has made Nutshell Handbooks(R) famous. C programming is more than just getting the syntax right. Style and debugging also play a tremen, Practical C Programming, Third Edition to your collection on WonderClub |