Book description
A comprehensive guide with practical instructions for learning data structures, low-level programming, high-performance computing, networking and IoT to help you understand the latest standards in C programming such as C11 and C18
Key Features
- Tackle various challenges in C programming by making the most of its latest features
- Understand the workings of arrays, strings, functions, pointers, advanced data structures, and algorithms
- Become well-versed with process synchronization during multitasking and server-client process communication
Book Description
Used in everything from microcontrollers to operating systems, C is a popular programming language among developers because of its flexibility and versatility. This book helps you get hands-on with various tasks, covering the fundamental as well as complex C programming concepts that are essential for making real-life applications.
You'll start with recipes for arrays, strings, user-defined functions, and pre-processing directives. Once you're familiar with the basic features, you'll gradually move on to learning pointers, file handling, concurrency, networking, and inter-process communication (IPC). The book then illustrates how to carry out searching and arrange data using different sorting techniques, before demonstrating the implementation of data structures such as stacks and queues. Later, you'll learn interesting programming features such as using graphics for drawing and animation, and the application of general-purpose utilities. Finally, the book will take you through advanced concepts such as low-level programming, embedded software, IoT, and security in coding, as well as techniques for improving code performance.
By the end of this book, you'll have a clear understanding of C programming, and have the skills you need to develop robust apps.
What you will learn
- Discover how to use arrays, functions, and strings to make large applications
- Perform preprocessing and conditional compilation for efficient programming
- Understand how to use pointers and memory optimally
- Use general-purpose utilities and improve code performance
- Implement multitasking using threads and process synchronization
- Use low-level programming and the inline assembly language
- Understand how to use graphics for animation
- Get to grips with applying security while developing C programs
Who this book is for
This intermediate-level book is for developers who want to become better C programmers by learning its modern features and programming practices. Familiarity with C programming is assumed to get the most out of this book.
Table of contents
- Title Page
- Copyright and Credits
- Dedication
- About Packt
- Contributors
- Preface
- Working with Arrays
- Managing Strings
- Exploring Functions
- Preprocessing and Compilation
- Deep Dive into Pointers
- File Handling
- Implementing Concurrency
-
Networking and Inter-Process Communication
- Communicating between processes using pipes
- Communicating between processes using FIFO
- Communicating between the client and server using socket programming
- Communicating between processes using a UDP socket
- Passing a message from one process to another using the message queue
- Communicating between processes using shared memory
- Sorting and Searching
-
Working with Graphs
- Types of graphs
- Creating an adjacency matrix representation of a directed graph
- Creating an adjacency matrix representation of an undirected graph
- Creating an adjacency list representation of a directed graph
- Carrying out the breadth-first traversal of a graph
- Carrying out the depth-first traversal of a graph
- Creating minimum spanning trees using Prim's algorithm
- Creating minimum spanning trees using Kruskal's algorithm
-
Advanced Data Structures and Algorithms
- Stack
- Doubly linked lists (two-way linked lists)
- Circular linked lists
- Binary tree
- Implementing a stack using a singly linked list
- Implementing a doubly or two-way linked list
- Implementing a circular linked list
- Creating a binary search tree and performing an inorder traversal on it recursively
- Performing postorder traversal of a binary tree non-recursively
- Creativity with Graphics
- Using MySQL Database
- General-Purpose Utilities
- Improving the Performance of Your Code
-
Low-Level Programming
- Introduction to bitwise operators
- Converting a binary number into a decimal using a bitwise operator
- Converting a decimal into binary using a bitwise operator
- Converting a decimal number into binary using bit masking 
- Introduction to assembly coding
- Multiplying two numbers using the inline assembly language in C
- Dividing two numbers using assembly code in C
-
Embedded Software and IoT
- Technical requirements
- Introduction to embedded systems
- Introduction to IoT
- Toggling the port of a microcontroller in Embedded C (blinking LED)
- Incrementing the value of a port in Embedded C
- Toggle voltage in output pin using Arduino (blinking LED)
- Taking input from the serial port using Arduino
- Sensing the temperature using Arduino with the LM35 sensor
-
Applying Security in Coding
- Buffer overflow
- Understanding how a buffer overflow occurs
- Learning how to avoid a buffer overflow 
- Understanding how a vulnerability occurs while copying strings
- Learning how to write secure code while copying strings
- Understanding the errors that occur while formatting strings
- Learning how to avoid errors while formatting strings
- Understanding how vulnerabilities occur while accessing files in C
- Learning how to avoid vulnerabilities while writing a file in C
- Other Books You May Enjoy
Product information
- Title: Practical C Programming
- Author(s):
- Release date: February 2020
- Publisher(s): Packt Publishing
- ISBN: 9781838641108
You might also like
book
Practical C Programming, 3rd Edition
There are lots of introductory C books, but this is the first one that has the …
book
C Programming
C Programming: Test Your Skills is specifically designed to be used as the supplementary resource for …
book
Expert C Programming
This book is for the knowledgeable C programmer, this is a second book that gives the …
video
Embedded Systems Object-Oriented Programming in C and C++
This Embedded Systems Object-Oriented Programming course will help you develop the skills you need to be …