Advanced C Programming: Pointers
4.7 (93 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
926 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Advanced C Programming: Pointers to your Wishlist.

Add to Wishlist

Advanced C Programming: Pointers

Master pointers, addresses and memory allocation in C
4.7 (93 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
926 students enrolled
Created by Huw Collingbourne
Last updated 6/2017
English
Current price: $10 Original price: $95 Discount: 89% off
5 hours left at this price!
30-Day Money-Back Guarantee
Includes:
  • 3.5 hours on-demand video
  • 3 Articles
  • 3 Supplemental Resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Pointers and addresses
  • Indirection and multiple indirection
  • Generic pointers and casts
  • Memory allocation and reallocation
  • Pointer arithmetic
  • Singly and doubly linked lists
  • Queues and stacks
  • Deep and shallow copying
  • Common pointer errors
View Curriculum
Requirements
  • You should understand at least the basics of C programming
Description

To be an expert C programmer you need to master the use of pointers. This course explains pointers in real depth. It explains pointer variables, pointer arithmetic, indirection, memory allocation, how to create and maintain linked lists and how to use function pointers. In fact, by the time you finish this course, you will know pointers inside out. You will understand what they are, how they work and how to make sure that they don’t make your programs crash!

This is not a course for beginners. It is aimed at programmers who already have a good working knowledge of C programming and who need to take the next step in mastering C by gaining a deep understanding of pointers.

If you’ve struggled with pointers  and can’t quite figure out what all those ‘arrow diagrams’ really mean or what exactly is the relationship between pointers and addresses, this is the course for you. In a series of short, tightly-targeted lessons, you will learn all about: 

  • computer memory and how pointers access it
  • how memory is allocated 
  • why copying data using pointers can cause program errors
  • why some pointers are ‘generic’ 
  • what happens when you ‘cast’ pointers to specific types
  • how to create singly and doubly linked lists
  • how to use stacks and queues
  • how to avoid memory leaks and other common problems
  • ...and much more.

The source code for all the example programs is provided, so if you need to try out my code you can load it and run it in your preferred C IDE or code editor.

Who is the target audience?
  • Any C programmer who needs to understand pointers in depth
Students Who Viewed This Course Also Viewed
Curriculum For This Course
59 Lectures
03:30:53
+
Pointer Basics
7 Lectures 14:49

Who this course is for and what you will get out of it.

Preview 02:44

What is in the course and how should you study it?

Preview 03:14

Course Notes and FAQ
00:06

Source Code Archive
00:04

Pointers and addresses - how are they related?

What is a pointer?
03:38

How to create and use a pointer variable in C.

Pointer variables
03:11

Dereferencing to get at the data that is ‘pointed to’.

Indirection
01:51

What are pointers?

Pointer Basics
4 questions
+
Addresses and Indirection
20 Lectures 01:25:42

The address of the array is the same as the address of the first item in the array. Why is that important?

Preview 03:46

How can pointer values be displayed?

How to display pointer values
00:06

Let’s see how pointers and addresses work – and why arrays are special.

Preview 05:50

Pointers to pointers

Multiple indirection
01:41

Pointers to pointers to integers

Multiple indirection with integers
08:00

Arrays of arrays of characters

Multiple Indirection with strings
04:57

What is **argv in the main() function?

Indirection and commandline args
03:20

Pointers to void

Generic Pointers
04:44

Setting aside storage space

Allocating memory
05:40

How to allocate the right amount of memory for a specific amount of data

Malloc and sizeof
04:44

Why does your C compiler will complain about some functions?

Functions that cause errors or warnings
02:49

How to clear memory before allocating

calloc
04:22

How to free memory that is no longer needed 

free
03:07

How to change the size of a block of allocated memory

realloc
04:03

What does it mean when you add 1 to a pointer?

Pointer arithmetic
05:03

Using pointer arithmetic with arrays

Calculating an array index
03:36

But how much memory does a struct need?

Pointers to structs
06:47

Why the order of fields in a struct is important

Data type alignment
08:45

Understanding that data types of a certain size are aligned on boundaries of that size

Type alignment on boundaries
02:06

Pointer arithmetic works with complex types as well as simple types

Type alignment and pointer arithmetic
02:16

The relationship between pointers, addresses and data stored in memory

Addresses and Indirection
4 questions
+
Lists and data structures
20 Lectures 01:10:52

Limitations of arrays and using linked lists as an alternative

Arrays and Lists
01:26

How is a linked list different from an array?

What is a linked list?
03:40

Lists that include one pointer linking each element to the next one

Singly linked lists
04:55

Do you really always need to free memory?

To free or not to free?
00:45

Lists whose elements contain pointers to each adjacent element

Doubly linked lists
02:10

An example showing how to create a simple double-linked list

Programming a doubly-linked List
03:20

Initializing a doubly-linked list not quite as simple as initializing a singly-linked list

Initializing a doubly-linked list
01:10

A sample project showing a doubly-linked list

Implementing a doubly linked list
10:09

Queues are very common data structures in programming – here I explain what they are

What is a queue?
02:35

Using a doubly linked list as a queue

Queues
04:23

A stack is another important type of data structure – here we see how it differs from a queue

What is a stack?
02:10

You may need pointers with a stack, but you may not need a linked list

Stacks
02:27

Adding and removing items to and from a stack

Pushing and popping
05:05

Iterating over list elements

Calculating the length of list
03:15

Making a new copy of an existing queue

Copying a list
04:02

How would you delete an item from the middle of a list?

Removing an element from within a list
06:17

How would you add an item into a list?

Adding an element into a list
04:49

What is a function pointer and what are they for?

Function pointers
01:04

The strange syntax for declaring a function pointer

Function pointer declarations
03:38

How a single piece of code can call different functions using function pointers

An array of function pointers
03:32

Pointers in linked lists, queues and stacks 

Lists and Data Structures
4 questions
+
Common Pointer Problems
12 Lectures 39:29

Pointers are one of the major sources of error in C programs. But why?

Why do pointers cause problems?
01:39

When is a copy not a copy?

Deep and shallow copies
03:54

Sometimes a copy may not be what you think it is!

A deeper look at deep and shallow copies
07:31

Allocating the wrong amount of memory is a recipe for disaster

Incorrect memory allocation
01:56

When you cast a pointer you are not really changing anything. But an incorrect cast can cause problems even so

Casting pointers
02:09

An example of a cast that didn’t work as expected

Incorrect casts
03:30

What happens if you free some memory twice?

Freeing already freed memory
03:06

When memory is allocated but not freed

Memory leaks
03:09

What happens when you try to use memory that has already been freed?

Using freed memory
02:13

Trying to access things that can’t be accessed

Pointers out of scope
04:12

What happens if you use a pointer that doesn’t point to anything?

Dereferencing a null pointer
01:40

Some common sources of error in C programs.

Common pointer problems
4 questions

That’s it! So where to next? Here are a few pointers…

And finally...
04:30
About the Instructor
Huw Collingbourne
4.4 Average rating
3,031 Reviews
53,859 Students
12 Courses
Director of Technology, SapphireSteel Software

Huw Collingbourne is the technology director at SapphireSteel Software, developers of programming tools for Microsoft Visual Studio. He is author of The Book Of Ruby from No Starch Press. He runs Bitwise Courses and teaches courses on a range of programming topics.

Huw has been a programmer for more than 30 years. He is a well-known technology writer in the UK. For over ten years he wrote the Delphi and Java programming column for PC Plus Magazine. He has also written numerous opinion and programming columns (including tutorials on C#, C++, Smalltalk and Ruby) for a number of computer magazines, such as Computer Shopper, PC Pro, and PC Plus

In the 1980s he was a pop music journalist and interviewed most of the New Romantic stars, such as Duran Duran, Spandau Ballet, Adam Ant, Boy George, and Depeche Mode. He is now writing a series of New Romantic murder mysteries.

At various times Huw has been a magazine publisher, editor, and TV broadcaster. He has an MA in English from the University of Cambridge and holds a 2nd dan black belt in aikido, a martial art which he teaches in North Devon, UK. The aikido comes in useful when trying (usually unsuccessfully) to keep his Pyrenean Mountain Dogs under some semblance of control.