Understanding and Using C Pointers
Core techniques for memory management
Publisher: O'Reilly Media
Final Release Date: May 2013
Pages: 226

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
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyUnderstanding and Using C Pointers
 
4.4

(based on 11 reviews)

Ratings Distribution

  • 5 Stars

     

    (6)

  • 4 Stars

     

    (4)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (1)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

  • Easy to understand (9)
  • Accurate (8)
  • Well-written (7)
  • Helpful examples (6)
  • Concise (4)

Cons

    Best Uses

    • Intermediate (9)
    • Student (6)
    • Novice (5)
    • Expert (3)
      • Reviewer Profile:
      • Developer (7)

    Reviewed by 11 customers

    Sort by

    Displaying reviews 1-10

    Back to top

    Previous | Next »

     
    2.0

    Good for a beginner to intermediate

    By Alan Rickman's Answering Machine

    from Alan Rickman's house, AR

    About Me Developer

    Verified Reviewer

    Pros

    • Accurate
    • Concise
    • Easy to understand

    Cons

    • Too basic

    Best Uses

    • Novice

    Comments about oreilly Understanding and Using C Pointers:

    I found the book to be like dry white bread; filling, palatable, and underwhelming. Everything is very clear and well laid out, but it never goes to the depth that would have made this topic interesting. Many times a subject or solution that could be interesting (e.g. implementing RAII in C without using the GNU extension) is simply stated to be possible without any further information.

    There are hyperlinks links scattered throughout the text, pointing to sites where further information can be found. This wouldn't be a problem if some of them weren't to the moving target that is Wikipedia. Indeed since the book's publication at least one of these has changed and the section originally linked to is no longer present.

    Basically the book reads like a set of source examples that are very well documented. I could see it being helpful to someone who's been hacking around in C/C++ for a few months and is ready to integrate their experience with pointers/the C memory model and really learn the fundamentals, but for anyone more experienced this won't offer much new.

    3 stars for a solid (if dry) book laying out the basics of pointers and memory management in C, minus one for having broken links to Wikipedia

     
    5.0

    Excellent material on C pointers

    By HF..

    from Melbourne , AU

    About Me Developer

    Verified Buyer

    Pros

    • Accurate
    • Easy to understand
    • Well-written

    Cons

      Best Uses

      • Intermediate
      • Novice
      • Student

      Comments about oreilly Understanding and Using C Pointers:

      I personally like this ebook.
      It's hard to find a C book that will focus mainly on Pointers, luckily I found this one.
      Thank you O'Reilly and special thanks to the author Richard Reese for his great efforts in writing this material.

      (4 of 4 customers found this review helpful)

       
      4.0

      Good Book on Pointers

      By Andy

      from Germany

      About Me Developer

      Verified Reviewer

      Pros

        Cons

          Best Uses

          • Expert
          • Intermediate

          Comments about oreilly Understanding and Using C Pointers:

          There have been many books written about the C Programming language. But this one is different. Why? Because this book focuses on pointers to convey a deeper understanding on C. It covers important memory management technology involving the stack and the heap along with the use of pointers in this context. It helps you to understand pointers and shows you how they work and how they should be managed.

          Reese assumes that the reader has a minimal understanding of C.
          The audience are developers that are learning C or experienced C or C++ programmers. For C# or Java developers this book should help to better understand C and get an insight into how object-oriented languages deal with the stack and the heap.

          IMHO the reader need a bit more than a minimal understanding of C. The book shows only code snippets (which will make it more difficult for novice programmers). So the reader need to know how to write a complete program in C and how to compile it.
          Further the reader need some understanding of common data structures like linked lists. If you are a C# or Java developer and don't have any C background this book won't be of much use for you.

          The Book uses a lot of references to later chapters (forward references), which makes it sometimes difficult to read.

          What I really liked on this book is the representation of the memory (as small boxes) along with the source code. It visually shows the reader what is happening in memory.

          This book really helped me to get a better understanding of Pointers and memory management.

          (1 of 1 customers found this review helpful)

           
          4.0

          A book for a novice and a master

          By Joaquin

          from La Plata, Argentina

          About Me Curious, Developer, Educator

          Verified Reviewer

          Pros

          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Expert
            • Intermediate
            • Novice
            • Student

            Comments about oreilly Understanding and Using C Pointers:

            The book give a list of very usefull examples. I use them in class and clarify a wide variety of common mistakes.

            (1 of 1 customers found this review helpful)

             
            5.0

            Very good books on Pointers

            By lakpa

            from London

            About Me Developer

            Pros

            • Accurate
            • Concise
            • Easy to understand
            • Helpful examples
            • Well-written

            Cons

              Best Uses

              • Intermediate

              Comments about oreilly Understanding and Using C Pointers:

              The book covers the every aspect of using pointer. The book can be a good reference for every C programmer as perfection in pointer what makes you an efficient programmer.

              (3 of 3 customers found this review helpful)

               
              5.0

              It is what it says to be

              By Riesje007

              from Amsterdam, The Netherlands

              About Me Developer, Maker, Sys Admin

              Verified Reviewer

              Pros

              • Accurate
              • Concise
              • Easy to understand
              • Well-written

              Cons

              • Only Small Code Snippets

              Best Uses

              • Intermediate
              • Student

              Comments about oreilly Understanding and Using C Pointers:

              The explanation of the subject of pointers is very clear and very helpful in further understanding the subject. The examples are very clear and the short code snippets supplied were useful. For less experienced users it may be a better idea to supply complete working programs as examples, but for me this was just fine.
              One thing however you must know if you use Microsoft Visual Studio compiler: define your variables in the first lines of every function and below them add the code, otherwise it doesn't compile and the error messages of the compiler aren't clear about this sequence.

              (1 of 1 customers found this review helpful)

               
              4.0

              Unleash the power of C!

              By Alessandro Costantini

              from Venezia, Italia

              Verified Reviewer

              Pros

              • Accurate
              • Easy to understand
              • Helpful examples
              • Well-written

              Cons

                Best Uses

                • Intermediate
                • Student

                Comments about oreilly Understanding and Using C Pointers:

                This extremely useful book is the one that will let you understand pointers and their usage. Many books fail on pointers, many books don't stress enough the role pointers have in C. This succeds.
                Not for absolute beginners, a must if you actually want to use C for real world applications.

                (3 of 3 customers found this review helpful)

                 
                4.0

                Pointers straight to the point

                By mko

                from Poland

                Verified Reviewer

                Pros

                • Accurate
                • Easy to understand
                • Helpful examples

                Cons

                • Not comprehensive enough

                Best Uses

                • Intermediate
                • Novice

                Comments about oreilly Understanding and Using C Pointers:

                Pointers are the nemesis of most of newcomers to C. There are few issues related to this topic. Pointers arithmetics is confusing, people get confused when it comes to characters and strings, array based arithmetics using pointers will not make any beginner happy. And, after all of that, comes pointers to functions and issues related to security (e.g. stack overflow).

                So far, I haven't found book so much focused on the topics as Understanding and Using C Pointers is. Typically, C related books try to cover all the aspects of the language, here on the contrary, we have different approach. What you get here are pointer related topics only. This means that you should be already familiar with C (at least in the way you are able to compile and run C based code). Various topics discussed in the book cover almost all of the aspects of the pointers. You will learn how pointers arithmetics work, how to allocate memory, how to deal with multidimensional arrays using pointers and dynamic allocation. Apart from typical usage of pointers you will also lear how to use them in context of functions (function pointers).

                I have found this book very useful, however, I think it might be still an issue to follow all the odds and ends by C newcomers. Some topics (e.g. arrays of function pointers) are explained such way it might be confusing. The problem here is that reader must understand and follow three different aspects of the problem at the same time: function pointer, array, character as indexes of arrays and, most confusing, why the hell do we declare 128 elements array if we only use two of them. I perfectly understand author's point of view, however, it is still confusing. Another issue is that illustrations in the book sometimes miss the proper description and explanation (in my opinion Kochan's C language book makes better use of them).

                Anyway, I still think that buying this book is an idea worth considering. If you know C, but would like to get familiar with odds and ends of pointers you should consider buying this one.

                (1 of 1 customers found this review helpful)

                 
                5.0

                A good read for a serious C programmer.

                By Satyajit

                from Pune, India

                Verified Reviewer

                Comments about oreilly Understanding and Using C Pointers:

                The book is well written, short that you can complete it quickly. As the author rightly points out in the preface many C books offer a broad coverage of the language and they seem to address only the tip of the iceberg named pointers. They often give you just a brief chapter on Pointers. But the fact is, in C, pointers are the most important concept. If you get that right you will start writing efficient C programs.

                The book starts with the basics of pointers to those who are not familiar with them. It moves on to explain dynamic memory management in C, using function pointers, pointer arithmetic and arrays, how to use structures and pointers. The good part of the book is at almost the end where the Author talks about common security issues and the improper uses of pointers. He talks a length about dangling pointers, accessing memory outside the bounds of an array.

                One might ask is it necessary to have a book on Pointers? I would say a definite yes. Memory management is a must if you want to go past the examples given in most C text books. I do not see any other book just dealing with pointers. So if you want to improve your C skills this book is a good read.

                (3 of 3 customers found this review helpful)

                 
                5.0

                Black Art of Pointer Magic Made Easy

                By teak

                from Jyväskylä, Finland

                About Me Designer, Developer

                Verified Reviewer

                Pros

                • Accurate
                • Easy to understand
                • Helpful examples
                • Well-written

                Cons

                  Best Uses

                  • Expert
                  • Intermediate
                  • Student

                  Comments about oreilly Understanding and Using C Pointers:

                  I would call this book "Black Art of Pointer Magic Made Easy". It is a rare pleasure to find a book with tittle and content matching exactly. I've been disappointed many times with tittles promising a lot more than what the book actually delivers. Many C++ books tip toe around pointers and just give you the absolute minimum information needed to work with basic issues around pointers. After reading this book you can really understand the magic of pointers.

                  I'm familiar with C only as a "subset" of C++ (which is of course erroneous) but understanding the memory management and pointers in C makes me a lot more confident if I ever have to use pure C. The book goes from pointer basics to "faking" objects in C. During this journey the book guides us through memory management in C, function pointers, character strings, structs, security issues, and other stuff too.
                  The book was also a joy to read as the text was well written.

                  I learned a lot from this book and I'm sure that I will use it as a reference book later on. I will recommend this to every one using C/C++.

                  disclaimer: I received this book free of charge from O'Reilly for review purpose.

                  Displaying reviews 1-10

                  Back to top

                  Previous | Next »

                   
                  Buy 2 Get 1 Free Free Shipping Guarantee
                  Buying Options
                  Immediate Access - Go Digital what's this?
                  Ebook: $33.99
                  Formats:  DAISY, ePub, Mobi, PDF
                  Print & Ebook: $43.99
                  Print: $39.99