YouTube30 Sept 2025
2h 56m

CS50 Fall 2025 - Lecture 4 - Memory (live, unedited)

Podcast cover

CS50

In this CS50 lecture, the speaker delves into the intricacies of memory management in C, explaining concepts like hexadecimal notation, pointers, and file I/O. The lecture begins with a discussion of how images are stored as pixels and transitions into an explanation of hexadecimal and binary systems. The speaker introduces pointers, memory addresses, and the importance of memory allocation using `malloc` and `free`, further illustrating common pitfalls such as memory leaks and buffer overflows, and introduces Valgrind, a tool for detecting memory-related errors. The lecture also covers file I/O operations, demonstrating how to create, open, write to, and close files, and addresses the concept of passing by value versus passing by reference, using a demonstration involving swapping the contents of glasses.

Outlines

Part 1: Memory Basics, Hexadecimal

Part 2: Pointers, Syntax, Strings

Part 3: Pointer Arithmetic, Memory Allocation

Part 4: Debugging, Memory Errors

Part 5: Scope, Stack, Heap

Part 6: Input, File I/O

Sign in to continue reading, translating and more.

Open full episode in Podwise