Save this video free

11.2 - Encapsulation (2026-11-06)

Chris Bourke · 49:20 · Watch on YouTube

Part of University of Nebraska-Lincoln CSCE 155E. See all 9 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Chris Bourke develops a C `Book` structure into a reusable interface with initialization, string formatting, dynamic creation, and cleanup functions. He then reviews Exam 3 topics including arrays, pointers, strings, memory management, and `strtok`, and previews upcoming coursework and Exam 4.

Key takeaways

Chapters

0:00 Opening Music Before the C Structures Lecture
2:21 Recapping the Book, Person, and Date Structures
4:00 Building `book_to_string` with `snprintf`-Style Formatting
11:26 Allocating Books with `malloc` and a Factory Function
18:20 Writing `free_book` and Verifying Cleanup with Valgrind
25:26 Exam 3 Review: Array Allocation, Indexing, and Reversal
32:00 Exam 3 Review: Matrices, Copies, and C Strings
40:00 Exam 3 Review: Memory Leaks, 2D Cleanup, and String Formatting
46:30 Upcoming Structures Work, Recursion, and Exam 4

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:05 [music] [music] [music] [music] [music] >> I want to love somebody. [music] I hear you need somebody to love. [music] Oh, I want to love somebody. I hear you looking for someone to love. 'Cause you need to

0:54 be back in the arms [music] of a good friend. And I need to be back in the arms [music] of a girlfriend. [music] I didn't know nobody. [music] And then I saw you coming my way. And I didn't know nobody. [music] And then I saw you coming my way. Don't you need to be [music] back in the arms of a good friend. Oh, just honey, believe me. I sure love to [music] call you my girlfriend.

1:43 [music] Woo! [music] All right. >> [music] [music] [music] >> All right. So, we started using structures last time. We went through a process of defining structures for a book, and then we also defined

2:30 them for ancillary structures for a person, which it represented the author, and then the date, which was used for date of birth for the author as an example, and then the date that the book was read. We also went through a process whereby we created a couple of utility functions. Those utility functions that we were making were to be able to print a book, right, to the standard output, to initialize a book, right? And then some supporting utility function here to do a deep string copy for us. We then use those so that everything looks nice and crisp and clean over here, where we are using using these functions to do all the heavy lifting for us, all right? Once once you've defined a structure, you can use them by declaring them like a regular old variable. So, instead of

3:19 int x equal to 42, you would have book

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Chris Bourke.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.