Загрузка...

C Programming: Pointers in 5 Minutes (No BS)

TL;DR: In 5 minutes you’ll get the pointer mental model: address vs value, & vs *, and how arrays/pointer arithmetic actually work.

Pointers are just variables that store memory addresses. Once that clicks, dereferencing, “pass-by-reference”, arrays, and malloc stop feeling like black magic.

Chapters:
0:00 What a pointer is (address vs value)
0:25 `&` operator: getting an address
0:55 `int *p = &x;` — reading the syntax
1:30 `*p` dereference: read the value at an address
2:00 Writing through a pointer: `*p = ...`
2:30 Common crashes: wild pointers, NULL, wrong types
3:30 Arrays + pointer arithmetic: `a[i] == *(a + i)`
4:25 `const int *p` vs `int *const p`
4:45 Where pointers show up for real: malloc + pass-by-reference
4:58 Quick exercises + answers

Resources:
- C pointers (official-ish overview):
- Operator precedence (so `*p` vs `int *p` makes sense):
- Memory model basics (stack vs heap):
- My code + examples (repo)

Exercises (answers are in the video):
1) If `int x=5; int *p=&x;` what is `*p + 1`?
2) If `p` is `0x100` and `sizeof(int)==4`, what is `p + 1`?
3) How do you declare a pointer to a pointer?

Pinned comment: If pointers still feel slippery, rewatch the address-vs-value slide—everything else is just notation.

Видео C Programming: Pointers in 5 Minutes (No BS) канала Coding Cossack
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять