Buy new:
$32.49$32.49
FREE delivery:
Wednesday, Feb 15
Ships from: Amazon.com Sold by: Amazon.com
Buy used: $6.77
Other Sellers on Amazon
+ $3.99 shipping
84% positive over last 12 months
& FREE Shipping
91% positive over last 12 months
Usually ships within 2 to 3 days.
+ $3.99 shipping
85% positive over last 12 months
Usually ships within 3 to 4 days.

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.


Understanding and Using C Pointers: Core Techniques for Memory Management 1st Edition
Price | New from | Used from |
- Kindle
$25.49 Read with Our Free App - Paperback
$6.77 - $32.49
Enhance your purchase
Improve your programming through a solid understanding of C pointers and memory management. With this practical book, you’ll learn how pointers provide the mechanism to dynamically manipulate memory, enhance support for data structures, and enable access to hardware. Author Richard Reese shows you how to use pointers with arrays, strings, structures, and functions, using memory models throughout the book.
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
- ISBN-101449344186
- ISBN-13978-1449344184
- Edition1st
- PublisherO'Reilly Media
- Publication dateMay 28, 2013
- LanguageEnglish
- Dimensions7 x 0.48 x 9.19 inches
- Print length226 pages
![]() |
What other items do customers buy after viewing this item?
Special offers and product promotions
- Buy 2, save 50% on 1. Offered by Amazon.com Shop items
Editorial Reviews
Amazon.com Review
Q&A with Richard Reese, author of "Understanding and Using C Pointers"
Q. Why is your book timely?
A. The C language continues to be a popular and widely used language. In addition, there are millions of lines of C code being maintained. Pointers are central to C and a solid understanding of them is important in crafting reliable and secure software. Understanding C pointers has always been important but they have not always been adequately covered. Their widespread usage in new and old applications begs a complete and comprehensive coverage.
Q. What do you hope that readers of your book will walk away with?
A. I hope that the experienced developer will be able to fill any holes in their understanding of C pointers. I hope that the less experienced developers will become more proficient and confident in their application of pointers.
Q. Can you give us a few tips on using pointers?
- Be careful when using pointers to void. If you cast a pointer to a pointer to void there is nothing preventing you from casting it to a different pointer type.
- When using function pointers the programmer must be careful to ensure it is used properly because C does not check to see if the correct parameters are passed.
- New code development should use the restrict keyword with most pointer declarations. This will enable better code optimization. Modifying existing code may not be worth the effort.
- Compilers do not always do a good job at reporting alias-related warnings. They can sometimes miss aliases and may sometimes report alias problems where they don't exist. It is ultimately up to the programmer to identify alias conditions.
- Remember NULL and NUL are different. NULL is used as a special pointer and is typically defined as ((void*)0). NUL is a char and is defined as '\0'. They should not be used interchangeably.
- Improperly aligned pointers can result in an abnormal program termination or retrieval of bad data. In addition, slower pointer access is possible if the compiler is required to generate additional machine code to compensate for the improper alignment.
About the Author
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.
Product details
- Publisher : O'Reilly Media; 1st edition (May 28, 2013)
- Language : English
- Paperback : 226 pages
- ISBN-10 : 1449344186
- ISBN-13 : 978-1449344184
- Item Weight : 13 ounces
- Dimensions : 7 x 0.48 x 9.19 inches
- Best Sellers Rank: #237,390 in Books (See Top 100 in Books)
- #6 in Memory Management Algorithms
- #31 in C Programming Language
- #63 in C++ Programming Language
- Customer Reviews:
About the authors
Richard Reese has worked in both industry and academics. For 17 years he worked in the telephone and aerospace industries, serving in several capacities including research and development, software development, supervision, and training. He currently teaches at Tarleton State University, where he has the opportunity to apply his years of industry experience to enhance his teaching.
Richard has written several Java books and a C Pointer book. He uses a concise and easy-to-follow approach to topics at hand. His Java books have addressed EJB 3.1, updates to Java 7 and 8, Certification, jMonkeyEngine, Natural Language Processing, Function programming, and Networks.
Richard Reese enjoys writing books and teaching. He has worked in industry for over 16 years and is currently an Associate Professor at Tarleton State University. He works his garden when he can and built a glass greenhouse to winter his plants.
Richard has written 5 books, four dealing with Java and one that addresses C Pointers. His latest book is Java 8 New Features - A Practical Heads-up Guide with p8tech. His next book will be about jMonkeyEngine, a system for developing 3D games in Java.
Many years ago he served in the United States Air Force in a couple of capacities, his last being a UHF/VHF radio technician for Titan II missile silos. He left the Air Force and earned a Bachelor and Masters Degree in Computer Science from Stephen F. Austin State University in Nacogdoches Texas. The next year he worked for GTE in Phoenix Arizona participating in the development of a class 5 telephone switch. Next, he went to Texas A&M University where he earned his doctorate in Computer Science in 1983.
Upon graduation he became an Assistant Professor in Computer Science at Stephen F. Austin State University for three years before returning to industry. He spent 10 years at GD/Lockheed in Fort Worth Texas working on several different programs. He spent the next 5 years as a contract trainer before returning to University life at Tarleton State University where he has been since 2002.
Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
The book, however, has several flaws. A lot of the material deals with nonstandard libraries. For example, the section on pointers and threads mentions C11 support for threads, but then discusses the POSIX standard rather than going into any details about the C standard. I found this and other references to extensions outside the C standard annoying; a book about C should focus on portable code.
Also, the book is not well organized. Throughout the book there are "forward references" saying that the topic being mentioned will be discussed elsewhere later. This leads to a lot of back-and-forth flipping of pages. For example, pointer arithmetic is explained in Chapter 1, but is used only in Chapter 4; a particular data structure is minimally introduced on page 133, then actually used sixty pages later. The way information is presented and explained could have been more systematic.
The biggest flaw is that some of the code is nonstandard and frankly, quite ugly. For instance:
(1) a function on page 87 uses pointers to memory that has already been deallocated, which is undefined behavior. The same function has redundant variables "length" and "currentPosition" -- one of the two would have been sufficient to accomplish the task.
(2) Elsewhere, Reese defines a linked list header structure with pointers to the head node, the tail node, and the current node. This structure is used at several later points in the book, but the reason for including a pointer to the current node is never made clear; none of the code in the book ever uses it, and indeed, it's difficult to see why it would be useful.
(3) While Reese explains the difference between the value 0 and the NUL character, in several places his code elides the difference, using the former where the latter would be more strictly appropriate (e.g., page 131 has `while (*string != 0)` when `while (*string != '\0')` or preferably `while (*string)` would be better style.
(4) Throughout, the book provides examples of infinite loops with break statements instead of using good structured style and having the break condition be the loop conditional.
(5) Surprisingly for a book that mentions the C99 and C11 standards often, there are a lot of references to using Microsoft Visual C++ as a compiler. Microsoft does not, and by all accounts never will, support C standards past C89. It is a C++ compiler, not a current C compiler. It mandates practices that are not C like in their philosophy, and Reese's code succumbs. For instance, he explicitly casts the return values from malloc and realloc to pointers of the appropriate type, which is not considered good C style. Good C code should be written in compliance to the C standard, not in conformance with the requirements imposed by a compiler geared to a different language.
The chronically problematic sample code is a serious shortcoming, and would be quite misleading for relatively new programmers. But then, the book is more a review of programming techniques using pointers than an introduction to them. It is geared more towards intermediate or experienced programmers than towards novices. For someone who has enough experience to be able to refactor the code properly, the book is a very useful review.
int *pi; // means "pi is a pointer to an int"
It clearly explains the use of the dereference operator in an lvalue:
*pi = 5 // The int 5 is assigned to memory location where pi points.
But it pointed out that this (very similar to the above) is a common error:
int *pi = 5; // We are declaring a pointer to an int, and then trying to assign the integer 5 to the pointer, not the integer memory location.
And that's all just in chapter 1! He helpfully diagrams memory after each use of pointers, making the difference between the stack, heap and the data segment (static memory) clear. There are detailed chapters on pointer use with dynamic memory, functions, arrays, strings, and structures.
It's nice to have an entire book focused entirely on pointers. The focused drill is clearing up confusion that plagued me for longer than I care to admit. Thank you!
A really happy Michael Stolzle,
All too common with math and theoretical CS authors, many or most of whom are professional educators, is the attitude that brevity is beauty. Whether they are interested in instilling their ideas in the reader is not evident from their writing. Reese provides the right level of detail and a coherent exposition which develops a solid intuition without having to re-read his explanations.
The conceptual diagrams are helpful but a little ambiguous in referencing which rectangle is the function stack, which is main, and which is the heap. I hope the author improves the diagrams in his next edition. I do not deduct any stars because this book is much better than anything else, and it covers essential CS material.
Top reviews from other countries





It skips all the other stuff covered by intro books and focuses on the real advantage of using C over other languages (i.e. pointers). I would recommend this book for new programmers or just as a refresher to others (as in my case).