Understanding and Using C Pointers (Paperback)

Richard M Reese

買這商品的人也買了...

商品描述

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

商品描述(中文翻譯)

提升你的程式設計能力,通過對 C 語言指標和記憶體管理的深入理解。這本實用書籍將教你如何使用指標來動態操作記憶體,增強對資料結構的支援,並實現對硬體的存取。作者 Richard Reese 透過整本書的內容,向你展示如何在陣列、字串、結構和函式中使用指標。

指標是一個難以掌握的概念,它為 C 語言提供了極大的靈活性和功能,然而很少有資源專門介紹這種資料型別。這本全面的書籍提供了你所需的資訊,無論你是初學者還是有經驗的 C 或 C++ 程式設計師或開發人員。

本書內容包括:
- 介紹指標,包括不同指標類型的聲明
- 學習動態記憶體配置、釋放和替代記憶體管理技術
- 使用技巧將資料傳遞給函式或從函式返回資料
- 理解陣列與指標的基本關係
- 探索字串的基礎知識以及指標在支援字串方面的應用
- 研究指標可能引起的安全問題,例如緩衝區溢位
- 學習多種指標技巧,例如使用不透明指標、有界指標和 restrict 關鍵字