Book description
This book is for the knowledgeable C programmer, this is a second book that gives the C programmers advanced tips and tricks. This book will help the C programmer reach new heights as a professional. Organized to make it easy for the reader to scan to sections that are relevant to their immediate needs.
Table of contents
- Cover Page
- About This eBook
- Title Page
- Copyright Page
- Dedication
- Contents
- Preface
- Acknowledgments
- Introduction
-
1. C Through the Mists of Time
- The Prehistory of C
- Early Experiences with C
- The Standard I/O Library and C Preprocessor
- K&R C
- The Present Day: ANSI C
- It’s Nice, but Is It Standard?
- Translation Limits
- The Structure of the ANSI C Standard
- Reading the ANSI C Standard for Fun, Pleasure, and Profit
- How Quiet is a “Quiet Change”?
- Some Light Relief—The Implementation-Defined Effects of Pragmas . . .
- 2. It’s Not a Bug, It’s a Language Feature
-
3. Unscrambling Declarations in C
- Syntax Only a Compiler Could Love
- How a Declaration Is Formed
- The Precedence Rule
- Unscrambling C Declarations by Diagram
- typedef Can Be Your Friend
- Difference Between typedef int x[10] and #define x int[10]
- What typedef struct foo { ... foo; } foo; Means
- The Piece of Code that Understandeth All Parsing
- Some Light Relief—Software to Bite the Wax Tadpole...
-
4. The Shocking Truth: C Arrays and Pointers Are NOT the Same!
- Arrays Are NOT Pointers!
- Why Doesn’t My Code Work?
- What’s a Declaration? What’s a Definition?
- How Arrays and Pointers Are Accessed
- Diagram A A Subscripted Array Reference
- Diagram B A Pointer Reference
- Diagram C A Subscripted Pointer Reference
- Match Your Declarations to the Definition
- Other Differences Between Arrays and Pointers
- Some Light Relief—Fun with Palindromes!
- 5. Thinking of Linking
-
6. Poetry in Motion: Runtime Data Structures
- a.out and a.out Folklore
- Segments
- What the OS Does with Your a.out
- What the C Runtime Does with Your a.out
- What Happens When a Function Gets Called: The Procedure Activation Record
- The auto and static keywords
- Threads of Control
- setjmp and longjmp
- The Stack Segment Under UNIX
- The Stack Segment Under MS-DOS
- Helpful C Tools
- Some Light Relief—Programming Puzzles at CMU
- For Advanced Students Only
- 7. Thanks for the Memory
-
8. Why Programmers Can’t Tell Halloween from Christmas Day
- The Potrzebie System of Weights and Measures
- Making a Glyph from Bit Patterns
- Types Changed While You Wait
- Prototype Painfulness
- Getting a Char Without a Carriage Return
- Implementing a Finite State Machine in C
- Software Is Harder than Hardware!
- How and Why to Cast
- Some Light Relief—The International Obfuscated C Code Competition
-
9. More about Arrays
- When an Array Is a Pointer
- Why the Confusion?
- Why C Treats Array Parameters as Pointers
- Indexing a Slice
- Arrays and Pointers Interchangeability Summary
- C Has Multidimensional Arrays...
- ...But Every Other Language Calls Them “Arrays of Arrays”
- How Multidimensional Arrays Break into Components
- How Arrays Are Laid Out in Memory
- How to Initialize Arrays
- Some Light Relief—Hardware/Software Trade-Offs
-
10. More About Pointers
- The Layout of Multidimensional Arrays
- An Array of Pointers Is an “Iliffe Vector”
- Using Pointers for Ragged Arrays
- Passing a One-Dimensional Array to a Function
- Using Pointers to Pass a Multidimensional Array to a Function
- Using Pointers to Return an Array from a Function
- Using Pointers to Create and Use Dynamic Arrays
- Some Light Relief—The Limitations of Program Proofs
-
11. You Know C, So C++ is Easy!
- Allez-OOP!
- Abstraction—Extracting Out the Essential Characteristics of a Thing
- Encapsulation—Grouping Together Related Types, Data, and Functions
- Showing Some Class—Giving User-Defined Types the Same Privileges as Predefined Types
- Availability
- Declarations
- How to Call a Method
- Inheritance—Reusing Operations that Are Already Defined
- Multiple Inheritance—Deriving from Two or More Base Classes
- Overloading—Having One Name for the Same Action on Different Types
- How C++ Does Operator Overloading
- Input/Output in C++
- Polymorphism—Runtime Binding
- Explanation
- How C++ Does Polymorphism
- Fancy Pants Polymorphism
- Other Corners of C++
- If I Was Going There, I Wouldn’t Start from Here
- It May Be Crufty, but It’s the Only Game in Town
- Some Light Relief—The Dead Computers Society
- Some Final Light Relief—Your Certificate of Merit!
- Further Reading
-
Appendix: Secrets of Programmer Job Interviews
- Silicon Valley Programmer Interviews
- How Can You Detect a Cycle in a Linked List?
- What Are the Different C Increment Statements For?
- How Is a Library Call Different from a System Call?
- How Is a File Descriptor Different from a File Pointer?
- Write Some Code to Determine if a Variable Is Signed or Not
- What Is the Time Complexity of Printing the Values in a Binary Tree?
- Give Me a String at Random from This File
- Some Light Relief—How to Measure a Building with a Barometer
- Further Reading
- Index
- Code Snippets
Product information
- Title: Expert C Programming
- Author(s):
- Release date: June 1994
- Publisher(s): Pearson
- ISBN: 9780131774292
You might also like
book
Practical C Programming
A comprehensive guide with practical instructions for learning data structures, low-level programming, high-performance computing, networking and …
book
Learn C Programming
Get started with writing simple programs in C while learning the skills that will help you …
book
C Programming Language, 2nd Edition
This book is meant to help the reader learn how to program in C. It is …
book
Programming in C, Fourth Edition
will teach you how to write programs in the C programming language. Whether you’re a novice …