Understanding and Using C Pointers
O'Reilly Media, Inc, USA (Verlag)
978-1-4493-4418-4 (ISBN)
Difficult to master, pointers provide C with much flexibility and power—yet few resources are dedicated to this data type. This comprehensive book has the information you need, whether you’re a beginner or an experienced C or C++ programmer or developer.
- Get an introduction to pointers, including the declaration of different pointer types
- Learn about dynamic memory allocation, de-allocation, and alternative memory management techniques
- Use techniques for passing or returning data to and from functions
- Understand the fundamental aspects of arrays as they relate to pointers
- Explore the basics of strings and how pointers are used to support them
- Examine why pointers can be the source of security problems, such as buffer overflow
- Learn several pointer techniques, such as the use of opaque pointers, bounded pointers and, the restrict keyword
Richard Reese has worked in the industry and academics for the past 29 years. For 10 years he provided software development support at Lockheed and at one point developed a C based network application. He was a contract instructor providing software training to industry for 5 years. Richard is currently an Associate Professor at Tarleton State University in Stephenville Texas.
Chapter 1 Introduction
Pointers and Memory
Pointer Size and Types
Pointer Operators
Common Uses of Pointers
Summary
Chapter 2 Dynamic Memory Management in C
Dynamic Memory Allocation
Dynamic Memory Allocation Functions
Deallocating Memory Using the free Function
Dangling Pointers
Dynamic Memory Allocation Technologies
Summary
Chapter 3 Pointers and Functions
Program Stack and Heap
Passing and Returning by Pointer
Function Pointers
Summary
Chapter 4 Pointers and Arrays
Quick Review of Arrays
Pointer Notation and Arrays
Using malloc to Create a One-Dimensional Array
Using the realloc Function to Resize an Array
Passing a One-Dimensional Array
Using a One-Dimensional Array of Pointers
Pointers and Multidimensional Arrays
Passing a Multidimensional Array
Dynamically Allocating a Two-Dimensional Array
Jagged Arrays and Pointers
Summary
Chapter 5 Pointers and Strings
String Fundamentals
Standard String Operations
Passing Strings
Returning Strings
Function Pointers and Strings
Summary
Chapter 6 Pointers and Structures
Introduction
Structure Deallocation Issues
Avoiding malloc/free Overhead
Using Pointers to Support Data Structures
Chapter 7 Security Issues and the Improper Use of Pointers
Pointer Declaration and Initialization
Pointer Usage Issues
Memory Deallocation Issues
Using Static Analysis Tools
Summary
Chapter 8 Odds and Ends
Casting Pointers
Aliasing, Strict Aliasing, and the restrict Keyword
Threads and Pointers
Object-Oriented Techniques
Summary
Colophon
Erscheint lt. Verlag | 11.6.2013 |
---|---|
Zusatzinfo | Illustrations |
Verlagsort | Sebastopol |
Sprache | englisch |
Maße | 178 x 233 mm |
Gewicht | 367 g |
Einbandart | kartoniert |
Themenwelt | Informatik ► Programmiersprachen / -werkzeuge ► C / C++ |
ISBN-10 | 1-4493-4418-6 / 1449344186 |
ISBN-13 | 978-1-4493-4418-4 / 9781449344184 |
Zustand | Neuware |
Haben Sie eine Frage zum Produkt? |
aus dem Bereich