• Complain

Thomas Mailund - Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays

Here you can read online Thomas Mailund - Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2021, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Thomas Mailund Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays
  • Book:
    Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2021
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Gain a better understanding of pointers, from the basics of how pointers function at the machine level, to using them for a variety of common and advanced scenarios. This short contemporary guide book on pointers in C programming provides a resource for professionals and advanced students needing in-depth hands-on coverage of pointer basics and advanced features. It includes the latest versions of the C language, C20, C17, and C14.

Youll see how pointers are used to provide vital C features, such as strings, arrays, higher-order functions and polymorphic data structures. Along the way, youll cover how pointers can optimize a program to run faster or use less memory than it would otherwise.

There are plenty of code examples in the book to emulate and adapt to meet your specific needs.

What You Will Learn

  • Work effectively with pointers in your C programming
  • Learn how to effectively manage dynamic memory
  • Program with strings and arrays
  • Create recursive data structures
  • Implement function pointers
Who This Book Is For

Intermediate to advanced level professional programmers, software developers, and advanced students or researchers. Prior experience with C programming is expected.

Thomas Mailund: author's other books


Who wrote Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays? Find out the surname, the name of the author of the book and a list of all author's works by series.

Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Contents
Landmarks
Book cover of Pointers in C Programming Thomas Mailund Pointers in C - photo 1
Book cover of Pointers in C Programming
Thomas Mailund
Pointers in C Programming
A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays
1st ed.
Logo of the publisher Thomas Mailund Aarhus N Denmark Any source code or - photo 2
Logo of the publisher
Thomas Mailund
Aarhus N, Denmark

Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/9781484269268 . For more detailed information, please visit http://www.apress.com/source-code .

ISBN 978-1-4842-6926-8 e-ISBN 978-1-4842-6927-5
https://doi.org/10.1007/978-1-4842-6927-5
Thomas Mailund 2021
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This Apress imprint is published by the registered company APress Media, LLC part of Springer Nature.

The registered company address is: 1 New York Plaza, New York, NY 10004, U.S.A.

Acknowledgments

I am grateful to Helge Jensen, Anders E. Halager, Irfansha Shaik, and Kristian Ozol for discussions and comments on earlier drafts of this book.

Table of Contents
About the Author
Thomas Mailund

is an associate professor in bioinformatics at Aarhus University, Denmark. He has a background in math and computer science. For the past decade, his main focus has been on genetics and evolutionary studies, particularly comparative genomics, speciation, and gene flow between emerging species. He has published String Algorithms in C, R Data Science Quick Reference, The Joys of Hashing, Domain-Specific Languages in R, Beginning Data Science in R, Functional Programming in R, and Metaprogramming in R, all from Apress, as well as other books.

About the Technical Reviewer
Juturi Narsimha Rao

has 9 years of experience as a software developer, lead engineer, project engineer, and individual contributor. His current focus is on advanced supply chain planning between the manufacturing industries and vendors.

Thomas Mailund 2021
T. Mailund Pointers in C Programming https://doi.org/10.1007/978-1-4842-6927-5_1
1. Introduction
Thomas Mailund
(1)
Aarhus N, Denmark

Pointers and memory management are considered among the most challenging issues to deal with in low-level programming languages such as C. It is not that pointers are conceptually difficult to understand, nor is it difficult to comprehend how we can obtain memory from the operating system and how we return the memory again so it can be reused. The difficulty stems from the flexibility with which pointers let us manipulate the entire state of a running program. With pointers, every object anywhere in a programs memory is available to usat least in principle. We can change any bit to our hearts desire. No data are safe from our pointers, not even the program that we runa running program is nothing but data in the computers memory, and in theory, we can modify our own code as we run it.

With such a power tool, it should hardly surprise that mistakes can be fatal for a program, and unfortunately, mistakes are easy to make when it comes to pointers. While pointers do have type information, type safety is minimal when you use them. If you point somewhere in memory and pronounce that you want that integer over there, you get an integer, no matter what the object over there really is. Treat it like an integer, and it behaves like an integer. Assign a value to it, and may the gods have mercy on your soul if it was supposed to be something else and something you need later. You have just destroyed the real object you pointed at.

If you are not careful, any small mistake can crash your programor worse. If you accidentally modify the incorrect data in your program, all your output is tainted. If you are lucky, it is easily detectable, and you are in for a fun few days of debugging. If you are less fortunate, you can make business decisions based on incorrect output for years to come, never realizing that the code you wrote is fooling you every time it runsor maybe not every time, just on infrequent occasions, so rare that you can never chase down the problem. When you have bugs caused by pointers (or uninitialized memory), they are not always reproducible. Your programs behavior might depend on which other programs are running concurrently on the computer. If you start debugging it, any code you add to the program to examine it will affect its behavior. Loading the program into a debugger will definitely change the behavior as well. I hope that you will never run into such bugsknown as Heisenbugs after Heisenbergs uncertainty principlebut if you mess around with pointers long enough, you likely will.

It sounds like pointers are something we should stay away from, and many high-level programming languages do try to avoid them. Instead, they provide alternative language constructions that are safer to use but provide much of the same functionality that we need pointers for in C. They are not as powerful but alleviate many of the dangers that raw memory pointers pose. In low-level languages such as C, we are programming much closer to the machine. The computer doesnt understand high-level constructions; it understands memory and chunks of bits, and in low-level languages, we can manipulate the computer at this fundamental level. We very rarely need to, nor do we want to, but when we choose to program in low-level languages, it is to get close to the machine, where we can write more efficient programs, measured in both speed and memory usage. And at this level, we get pointersmore efficient, more fundamental, and more dangerous. If, however, we approach using pointers in a structured manner, we can achieve the safety of high-level languages and the efficiency of low-level languages. The burden is on the programmer, rather than the language designer, but we can get the best of both worlds for anything that you can do in a high-level languagewhile maintaining the real power of pointers in the rare cases where you need more.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays»

Look at similar books to Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays»

Discussion, reviews of the book Pointers in C Programming: A Modern Approach to Memory Management, Recursive Data Structures, Strings, and Arrays and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.