
Beginning C
From Novice to Professional
By:Â Ivor Horton
Hardcover | 1 November 2006 | Edition Number 4
At a Glance
640 Pages
Revised
26.2 x 18.8 x 4.2
New Edition
Hardcover
$139.75
or 4 interest-free payments of $34.94 with
 orÂShips in 5 to 7 business days
Industry Reviews
From the reviews of the fourth edition:
"This tutorial is intended for a wide range of readers, from nonprogrammers to those with programming experience who don't know the C language. The book's goal is to be a comprehensive text that will lead the prospective programmer from his or her starting point all the way to a career in programming. ... It also gives a good overview of the process of program creation, including a section on dealing with errors." (William Fahle, ACM Computing Reviews, Vol. 49 (4), April, 2008)
| About the Author | p. xix |
| Acknowledgments | p. xxi |
| Introduction | p. xxiii |
| Programming in C | p. 1 |
| Creating C Programs | p. 1 |
| Editing | p. 1 |
| Compiling | p. 2 |
| Linking | p. 3 |
| Executing | p. 3 |
| Creating Your First Program | p. 4 |
| Editing Your First Program | p. 5 |
| Dealing with Errors | p. 6 |
| Dissecting a Simple Program | p. 7 |
| Comments | p. 7 |
| Preprocessing Directives | p. 8 |
| Defining the main() Function | p. 9 |
| Keywords | p. 9 |
| The Body of a Function | p. 10 |
| Outputting Information | p. 10 |
| Arguments | p. 11 |
| Control Characters | p. 11 |
| Developing Programs in C | p. 13 |
| Understanding the Problem | p. 13 |
| Detailed Design | p. 14 |
| Implementation | p. 14 |
| Testing | p. 14 |
| Functions and Modular Programming | p. 14 |
| Common Mistakes | p. 18 |
| Points to Remember | p. 18 |
| Summary | p. 19 |
| Exercises | p. 20 |
| First Steps in Programming | p. 21 |
| Memory in Your Computer | p. 21 |
| What Is a Variable? | p. 23 |
| Variables That Store Numbers | p. 24 |
| Integer Variables | p. 24 |
| Naming Variables | p. 27 |
| Using Variables | p. 29 |
| Initializing Variables | p. 30 |
| Arithmetic Statements | p. 31 |
| Variables and Memory | p. 37 |
| Integer Variable Types | p. 38 |
| Unsigned Integer Types | p. 38 |
| Using Integer Types | p. 39 |
| Specifying Integer Constants | p. 40 |
| Floating-Point Values | p. 41 |
| Floating-Point Variables | p. 42 |
| Division Using Floating-Point Values | p. 43 |
| Controlling the Number of Decimal Places | p. 44 |
| Controlling the Output Field Width | p. 44 |
| More Complicated Expressions | p. 45 |
| Defining Constants | p. 48 |
| Knowing Your Limitations | p. 50 |
| Introducing the size of Operator | p. 52 |
| Choosing the Correct Type for the Job | p. 54 |
| Explicit Type Conversion | p. 57 |
| Automatic Conversion | p. 57 |
| Rules for Implicit Conversions | p. 57 |
| Implicit Conversions in Assignment Statements | p. 58 |
| More Numeric Data Types | p. 59 |
| The Character Type | p. 59 |
| Character Input and Character Output | p. 60 |
| The Wide Character Type | p. 63 |
| Enumerations | p. 64 |
| Variables to Store Boolean Values | p. 66 |
| The Complex Number Types | p. 67 |
| The op= Form of Assignment | p. 70 |
| Mathematical Functions | p. 71 |
| Designing a Program | p. 72 |
| The Problem | p. 72 |
| The Analysis | p. 73 |
| The Solution | p. 75 |
| Summary | p. 79 |
| Exercises | p. 80 |
| Making Decisions | p. 81 |
| The Decision-Making Process | p. 81 |
| Arithmetic Comparisons | p. 82 |
| Expressions Involving Relational Operators | p. 82 |
| The Basic if Statement | p. 82 |
| Extending the if Statement: if-else | p. 86 |
| Using Blocks of Code in if Statements | p. 88 |
| Nested if Statements | p. 89 |
| More Relational Operators | p. 92 |
| Logical Operators | p. 96 |
| The Conditional Operator | p. 99 |
| Operator Precedence: Who Goes First? | p. 102 |
| Multiple-Choice Questions | p. 106 |
| Using else-if Statements for Multiple Choices | p. 106 |
| The switch Statement | p. 107 |
| The goto Statement | p. 115 |
| Bitwise Operators | p. 116 |
| The op= Use of Bitwise Operators | p. 119 |
| Using Bitwise Operators | p. 119 |
| Designing a Program | p. 122 |
| The Problem | p. 122 |
| The Analysis | p. 122 |
| The Solution | p. 123 |
| Summary | p. 126 |
| Exercises | p. 126 |
| Loops | p. 129 |
| How Loops Work | p. 129 |
| Introducing the Increment and Decrement Operators | p. 130 |
| The for Loop | p. 131 |
| General Syntax of the for Loop | p. 135 |
| More on the Increment and Decrement Operators | p. 136 |
| The Increment Operator | p. 136 |
| The Prefix and Postfix Forms of the Increment Operator | p. 137 |
| The Decrement Operator | p. 137 |
| The for Loop Revisited | p. 138 |
| Modifying the for Loop Variable | p. 140 |
| A for Loop with No Parameters | p. 141 |
| The break Statement in a Loop | p. 141 |
| Limiting Input Using a for Loop | p. 144 |
| Generating Pseudo-Random Integers | p. 146 |
| More for Loop Control Options | p. 148 |
| Floating-Point Loop Control Variables | p. 149 |
| The while Loop | p. 149 |
| Nested Loops | p. 153 |
| Nested Loops and the goto Statement | p. 156 |
| The do-while Loop | p. 157 |
| The continue Statement | p. 160 |
| Designing a Program | p. 160 |
| The Problem | p. 160 |
| The Analysis | p. 160 |
| The Solution | p. 162 |
| Summary | p. 172 |
| Exercises | p. 173 |
| Arrays | p. 175 |
| An Introduction to Arrays | p. 175 |
| Programming Without Arrays | p. 175 |
| What Is an Array? | p. 177 |
| Using Arrays | p. 178 |
| A Reminder About Memory | p. 181 |
| Arrays and Addresses | p. 184 |
| Initializing an Array | p. 186 |
| Finding the Size of an Array | p. 186 |
| Multidimensional Arrays | p. 187 |
| Initializing Multidimensional Arrays | p. 189 |
| Designing a Program | p. 194 |
| The Problem | p. 194 |
| The Analysis | p. 194 |
| The Solution | p. 195 |
| Summary | p. 202 |
| Exercises | p. 202 |
| Applications with Strings and Text | p. 203 |
| What Is a String? | p. 203 |
| String- and Text-Handling Methods | p. 205 |
| Operations with Strings | p. 208 |
| Appending a String | p. 208 |
| Arrays of Strings | p. 210 |
| String Library Functions | p. 212 |
| Copying Strings Using a Library Function | p. 212 |
| Determining String Length Using a Library Function | p. 213 |
| Joining Strings Using a Library Function | p. 214 |
| Comparing Strings | p. 215 |
| Searching a String | p. 218 |
| Analyzing and Transforming Strings | p. 221 |
| Converting Characters | p. 224 |
| Converting Strings to Numerical Values | p. 227 |
| Working with Wide Character Strings | p. 227 |
| Operations on Wide Character Strings | p. 228 |
| Testing and Converting Wide Characters | p. 229 |
| Designing a Program | p. 231 |
| The Problem | p. 231 |
| The Analysis | p. 231 |
| The Solution | p. 231 |
| Summary | p. 238 |
| Exercises | p. 239 |
| Pointers | p. 241 |
| A First Look at Pointers | p. 241 |
| Declaring Pointers | p. 242 |
| Accessing a Value Through a Pointer | p. 243 |
| Using Pointers | p. 246 |
| Pointers to Constants | p. 250 |
| Constant Pointers | p. 251 |
| Naming Pointers | p. 251 |
| Arrays and Pointers | p. 251 |
| Multidimensional Arrays | p. 255 |
| Multidimensional Arrays and Pointers | p. 259 |
| Accessing Array Elements | p. 260 |
| Using Memory As You Go | p. 263 |
| Dynamic Memory Allocation: The malloc() Function | p. 263 |
| Memory Allocation with the calloc() Function | p. 268 |
| Releasing Dynamically Allocated Memory | p. 268 |
| Reallocating Memory | p. 270 |
| Handling Strings Using Pointers | p. 271 |
| String Input with More Control | p. 272 |
| Using Arrays of Pointers | p. 273 |
| Designing a Program | p. 283 |
| The Problem | p. 283 |
| The Analysis | p. 284 |
| The Solution | p. 284 |
| Summary | p. 294 |
| Exercises | p. 294 |
| Structuring Your Programs | p. 295 |
| Program Structure | p. 295 |
| Variable Scope and Lifetime | p. 296 |
| Variable Scope and Functions | p. 299 |
| Functions | p. 299 |
| Defining a Function | p. 300 |
| The return Statement | p. 304 |
| The Pass-By-Value Mechanism | p. 307 |
| Function Declarations | p. 309 |
| Pointers As Arguments and Return Values | p. 310 |
| const Parameters | p. 313 |
| Returning Pointer Values from a Function | p. 322 |
| Incrementing Pointers in a Function | p. 326 |
| Summary | p. 326 |
| Exercises | p. 327 |
| More on Functions | p. 329 |
| Pointers to Functions | p. 329 |
| Declaring a Pointer to a Function | p. 329 |
| Calling a Function Through a Function Pointer | p. 330 |
| Arrays of Pointers to Functions | p. 333 |
| Pointers to Functions As Arguments | p. 335 |
| Variables in Functions | p. 338 |
| Static Variables: Keeping Track Within a Function | p. 338 |
| Sharing Variables Between Functions | p. 340 |
| Functions That Call Themselves: Recursion | p. 343 |
| Functions with a Variable Number of Arguments | p. 345 |
| Copying a va_list | p. 348 |
| Basic Rules for Variable-Length Argument Lists | p. 348 |
| The main() Function | p. 349 |
| Ending a Program | p. 350 |
| Libraries of Functions: Header Files | p. 351 |
| Enhancing Performance | p. 352 |
| Declaring Functions inline | p. 352 |
| Using the restrict Keyword | p. 353 |
| Designing a Program | p. 353 |
| The Problem | p. 353 |
| The Analysis | p. 354 |
| The Solution | p. 356 |
| Summary | p. 371 |
| Exercises | p. 372 |
| Essential Input and Output Operations | p. 373 |
| Input and Output Streams | p. 373 |
| Standard Streams | p. 374 |
| Input from the Keyboard | p. 375 |
| Formatted Keyboard Input | p. 376 |
| Input Format Control Strings | p. 376 |
| Characters in the Input Format String | p. 382 |
| Variations on Floating-Point Input | p. 383 |
| Reading Hexadecimal and Octal Values | p. 384 |
| Reading Characters Using scanf() | p. 386 |
| Pitfalls with scanf() | p. 388 |
| String Input from the Keyboard | p. 388 |
| Unformatted Input from the Keyboard | p. 389 |
| Output to the Screen | p. 394 |
| Formatted Output to the Screen Using printf() | p. 394 |
| Escape Sequences | p. 396 |
| Integer Output | p. 397 |
| Outputting Floating-Point Values | p. 400 |
| Character Output | p. 401 |
| Other Output Functions | p. 403 |
| Unformatted Output to the Screen | p. 404 |
| Formatted Output to an Array | p. 404 |
| Formatted Input from an Array | p. 405 |
| Sending Output to the Printer | p. 405 |
| Summary | p. 406 |
| Exercises | p. 406 |
| Structuring Data | p. 409 |
| Data Structures: Using struct | p. 409 |
| Defining Structure Types and Structure Variables | p. 411 |
| Accessing Structure Members | p. 411 |
| Unnamed Structures | p. 414 |
| Arrays of Structures | p. 414 |
| Structures in Expressions | p. 417 |
| Pointers to Structures | p. 417 |
| Dynamic Memory Allocation for Structures | p. 418 |
| More on Structure Members | p. 420 |
| Structures As Members of a Structure | p. 420 |
| Declaring a Structure Within a Structure | p. 421 |
| Pointers to Structures As Structure Members | p. 422 |
| Doubly Linked Lists | p. 426 |
| Bit-Fields in a Structure | p. 429 |
| Structures and Functions | p. 430 |
| Structures As Arguments to Functions | p. 430 |
| Pointers to Structures As Function Arguments | p. 431 |
| A Structure As a Function Return Value | p. 432 |
| An Exercise in Program Modification | p. 436 |
| Binary Trees | p. 439 |
| Sharing Memory | p. 447 |
| Unions | p. 448 |
| Pointers to Unions | p. 450 |
| Initializing Unions | p. 450 |
| Structures As Union Members | p. 450 |
| Defining Your Own Data Types | p. 451 |
| Structures and the typedef Facility | p. 452 |
| Simplifying Code Using typedef | p. 453 |
| Designing a Program | p. 454 |
| The Problem | p. 454 |
| The Analysis | p. 454 |
| The Solution | p. 454 |
| Summary | p. 464 |
| Exercises | p. 465 |
| Working with Files | p. 467 |
| The Concept of a File | p. 467 |
| Positions in a File | p. 468 |
| File Streams | p. 468 |
| Accessing Files | p. 468 |
| Opening a File | p. 469 |
| Renaming a File | p. 471 |
| Closing a File | p. 472 |
| Deleting a File | p. 472 |
| Writing to a Text File | p. 473 |
| Reading from a Text File | p. 474 |
| Writing Strings to a Text File | p. 476 |
| Reading Strings from a Text File | p. 477 |
| Formatted File Input and Output | p. 480 |
| Formatted Output to a File | p. 481 |
| Formatted Input from a File | p. 481 |
| Dealing with Errors | p. 483 |
| Further Text File Operation Modes | p. 484 |
| Binary File Input and Output | p. 485 |
| Specifying Binary Mode | p. 486 |
| Writing a Binary File | p. 486 |
| Reading a Binary File | p. 487 |
| Moving Around in a File | p. 495 |
| File Positioning Operations | p. 495 |
| Finding Out Where You Are | p. 496 |
| Setting a Position in a File | p. 496 |
| Using Temporary Work Files | p. 502 |
| Creating a Temporary Work File | p. 502 |
| Creating a Unique File Name | p. 502 |
| Updating Binary Files | p. 503 |
| Changing the File Contents | p. 508 |
| Reading a Record from the Keyboard | p. 509 |
| Writing a Record to a File | p. 510 |
| Reading a Record from a File | p. 511 |
| Writing a File | p. 512 |
| Listing the File Contents | p. 513 |
| Updating the Existing File Contents | p. 514 |
| File Open Modes Summary | p. 521 |
| Designing a Program | p. 521 |
| The Problem | p. 522 |
| The Analysis | p. 522 |
| The Solution | p. 522 |
| Summary | p. 527 |
| Exercises | p. 527 |
| Supporting Facilities | p. 529 |
| Preprocessing | p. 529 |
| Including Header Files in Your Programs | p. 530 |
| External Variables and Functions | p. 530 |
| Substitutions in Your Program Source Code | p. 531 |
| Macro Substitutions | p. 532 |
| Macros That Look Like Functions | p. 532 |
| Preprocessor Directives on Multiple Lines | p. 534 |
| Strings As Macro Arguments | p. 534 |
| Joining Two Results of a Macro Expansion | p. 535 |
| Logical Preprocessor Directives | p. 536 |
| Conditional Compilation | p. 536 |
| Directives Testing for Specific Values | p. 537 |
| Multiple-Choice Selections | p. 537 |
| Standard Preprocessing Macros | p. 538 |
| Debugging Methods | p. 538 |
| Integrated Debuggers | p. 539 |
| The Preprocessor in Debugging | p. 539 |
| Using the assert() Macro | p. 543 |
| Additional Library Functions | p. 545 |
| The Date and Time Function Library | p. 545 |
| Getting the Date | p. 549 |
| Summary | p. 555 |
| Exercises | p. 555 |
| Computer Arithmetic | p. 557 |
| Binary Numbers | p. 557 |
| Hexadecimal Numbers | p. 558 |
| Negative Binary Numbers | p. 560 |
| Big-Endian and Little-Endian Systems | p. 561 |
| Floating-Point Numbers | p. 562 |
| ASCII Character Code Definitions | p. 565 |
| Reserved Words in C | p. 571 |
| Input and Output Format Specifications | p. 573 |
| Output Format Specifications | p. 573 |
| Input Format Specifications | p. 576 |
| Index | p. 579 |
| Table of Contents provided by Ingram. All Rights Reserved. |
ISBN: 9781590597354
ISBN-10: 1590597354
Series: Beginning: from Novice to Professional
Published: 1st November 2006
Format: Hardcover
Language: English
Number of Pages: 640
Audience: General Adult
Publisher: Springer Nature B.V.
Country of Publication: GB
Edition Number: 4
Edition Type: Revised
Dimensions (cm): 26.2 x 18.8 x 4.2
Weight (kg): 1.31
Shipping
| Standard Shipping | Express Shipping | |
|---|---|---|
| Metro postcodes: | $9.99 | $14.95 |
| Regional postcodes: | $9.99 | $14.95 |
| Rural postcodes: | $9.99 | $14.95 |
Orders over $79.00 qualify for free shipping.
How to return your order
At Booktopia, we offer hassle-free returns in accordance with our returns policy. If you wish to return an item, please get in touch with Booktopia Customer Care.
Additional postage charges may be applicable.
Defective items
If there is a problem with any of the items received for your order then the Booktopia Customer Care team is ready to assist you.
For more info please visit our Help Centre.


























