CS50x 2025 - Lecture 4 - Memory

preview_player
Показать описание
***

Pointers. Segmentation Faults. Dynamic Memory Allocation. Stack. Heap. Buffer Overflow. File I/O. Images.

***

This is CS50, Harvard University's introduction to the intellectual enterprises of computer science and the art of programming.

***

TABLE OF CONTENTS

00:00:00 - Introduction
00:01:15 - Pixel Art
00:06:54 - Hexadecimal
00:15:52 - Memory
00:18:44 - Pointers
00:35:16 - Strings
00:52:00 - Pointer Arithmetic
00:57:50 - Erratum
00:58:22 - String Comparison
01:08:43 - Copying and malloc
01:24:45 - Valgrind
01:31:29 - Garbage Values
01:35:48 - Pointer Fun with Blinky
01:38:43 - Swapping
01:56:30 - Overflow
02:01:24 - scanf
02:11:10 - File I/O

***

HOW TO SUBSCRIBE

HOW TO TAKE CS50

HOW TO JOIN CS50 COMMUNITIES

HOW TO FOLLOW DAVID J. MALAN

***

CS50 SHOP

***

LICENSE

CC BY-NC-SA 4.0
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License

David J. Malan
Рекомендации по теме
Комментарии
Автор

This guy is a great teacher. My first CS class was in C#. On the first day (thursday) the 'professor' didn't even introduce "Hello world" or any other programs, just talked about how she previously programmed xerox machines and never introduced anything related to CS.

She basically told us "read these chapters then make a scientific calculator with a GUI by monday. Class dismissed"

It's refreshing to see that people still have passion for what they do

Smiley_Frown
Автор

i love watching the unedited lectures there are so many relatable bloopers

webothwentmad
Автор

I watched up until like lecture 4 or 5 in 2022, but now that I'm rewatching these lectures things make so much more sense! I plan to watch them all this time.

coffeebirdtree
Автор

41:49 “So, some person, years ago, literally implemented ‘printf’…” That person – with the utmost degree of confidence – was none other than Dennis M. Ritchie 😊 one of the greatest original computer science superheroes. And a humble creator of the C programming language.

luchtaj
Автор

Well, now I actually understand pointers. Thanks!

mynameisearlb
Автор

2:55:00 My email suggestion made it to CS50!!

sbvtiyq
Автор

That claymation bit looks like the start of an analog horror series that Wendigoon needs to make an iceberg of.

KrigRaseri
Автор

I am attempting to watch this entire series.

FuUtAmAaSA
Автор

40:03 "code is generally read right to left". So, is that after compiling? The machine code and binary are right to left from how we see it? Or the computer just starts at the end and works its way to the left of each line?

captainmilk
Автор

I think it would be helpful in include an explanation of the address bus and data bus to explain what an address is and what the CPU does with addresses. It grounds something that seems virtual in reality which I think helps to make the concept stick better. It delves into the electrical engineering world but that is already breached by talking about cells in a memory chip. I don't think it would add a lot of time to the lecture

gregoryp
Автор

2:11:00 can't we just let variable like a or whatever be the exact amount of what users writes? so we don't dedicate an exact amount in advance so it depends on what the user write so the memory will be allocated after not before the user write

nourhemzawi
Автор

23:06 so do we print the pointer value of p or of n with %p notation?

madplayer
Автор

I finished CS50x 2024, but I want to do a full revision by rewatching it, should I rewatch the 2025 version instead of 2024? Anyone knows if it’s better to do that?

gamegear
Автор

We should stop calling pointers pointers and instead call them references. Then reference(*) and deference(&) operator would make more sense and be less confusing.

_Verac
Автор

she overflow my stack until I heap hehe xd

sotvrno
Автор

It's GIF and PNG, not JIFF and PING.

JacquesCoetzerAU