Art of C programming
Material type: TextPublication details: New York Springer-Verlag 1987Description: xiii,186pISBN:- 3540963928
- 005.133 JON
Item type | Current library | Collection | Call number | Status | Date due | Barcode | Item holds | |
---|---|---|---|---|---|---|---|---|
Book | CEPT Library | BK | 005.133 JON | Available | 015523 |
Contents
Preface vii
CHAPTER 1
Compilers and Interpreters 1
Editors 2
The Compilation Process 2
CHAPTER 2
The Skeleton of a C Program 5
Plus ca Change ... 6
Vive la Difference 7
Simple and Compound Statements 7
Functions That Don't Return Values 8
Returning Values 9
Main 9
Variable Types 10
Variable Scope 11
Global Variables 11
Loose Ends 12
printf 13
Comments 13
CHAPTER 3
Loops and Control Constructs 15
If 15
Conditional Expressions 16
Logical Connectives 17
Loops 17
while 17
Autoincrements 18
The sqr Function 19
do-while 22
for loops 23
CHAPTER 4
Arithmetic and Logic 26
Odds and Evens 27
Logical Operators 27
ASCII Code 28
AND 28
OR 29
XOR 30
NOT 31
Shifts 32
CHAPTER 5
Strings, Arrays, and Pointers 35
Strings and Pointers 35
Arrays 37
Declaring Arrays 37
String Functions 38
Left-Hand Bit 39
Right a Bit 40
More about Pointers 40
Left Again 41
Further Right 41
Copycat 42
CHAPTER 6
Floats and Other Types 45
float 45
double 45
Qualifiers for int 46
Signs and Shifts 46
Register Variables 47
Declaring Structures 47
Defining Your Own Types 48
Constants and Initializers 48
Character Constants 49
Handling Control Characters 49
Defining Your Own Constants 50
Variable Constants 51
# include 52
Octal and Hexadscimal Constants 52
Initializers 54
Initializing Pointers 54
Declaring Function Types 55
CHAPTER 7
Input 57
Primitive Input 57
Get a Bufferfull 57
Operator Precedence 59
Strings to Numbers 60
A Feeble Excuse 63
scanf 64
CHAPTER 8
Output 66
More about printf 67
Justification 67
Printing to Memory 67
Primitive Output 68
CHAPTER 9
More About Control Constructs 70
The Conditional Operator 70
Leaping out of Loops 71
Continuing 71
Multiway Switches 72
Do Not Pass Go 73
CHAPTER 10
Recursion 75
Factorials 76
Things with Strings 77
Back-to-Front Sentences 79
In and Out 80
Reversing the Text 81
Postscript 83
CHAPTER 11
Structures 84
Playing with Structures 85
The Storeman's Mate 86
Delete 88
Add 89
Recursive Structures 90
CHAPTER 12
File-handling 93
I/O Redirection 94
Error Messages 94
Buffered File I/O 95
fopen 95
Creating a File 96
Once More, with Filing 97
File Access Errors 98
Random Access Files 99
The Square Table 100
Second Attempt 100
Reversing the Process 101
CHAPTER 13
Debugging 106
Common Errors 107
Runtime Errors 108
Testing a Function 109
Test Lines 110
Be Thorough 112
Dormant Bugs 113
CHAPTER 14
Rational Arithmetic 117
Fixing the Problem 118
Overflow 119
A Practical Organization 120
Functions 121
E>ouble or Nothing 122
Portability Considerations 125
Lies, Damned Lies and Computer Programs 126
Subtraction 126
Multiplication 127
Division 127
The Conversion Routines 127
And Now the Bad News ... 129
Postscript 131
CHAPTER 15
Implementing Turtle Graphics ... 132
Turning Turtle 133
But First, The Snags ... 134
Triggery—Pokery 134
The Turtle Commands 137
Turtle Incorporated 139
Seeketh after a Sine 140
A Trig Suite in C 143
CHAPTER 16
and Using Them 145
Rectangles 146
Fan-Dancing 147
Polygons 149
Circle 151
Stars 151
Spirals 151
The Koch Snowflake 152
Afterthoughts... 155
CHAPTER 17
Random Thoughts 157
Some Basic Ideas 158
Testing "Randomness' 159
The Numerical Connection 160
Linear Feedback Shift Registers 162
A Practical Program 163
APPENDIX 1
Loose Ends 169
APPENDIX 2
Quick Reference Guide 176
Index 183
There are no comments on this title.