C in 100 Seconds: Pointers — Two Ways to Access the Same Memory | Episode 17
0views
00T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
A pointer holds a memory address — not a value, but the location of a value. Ampersand gets the address. Star follows the address back to the
value. Change the value through the pointer and the original variable changes too.
int star ptr declares a pointer. Ampersand x gives the address of x. Star ptr reads or writes the value at that address. x started at forty-two
— we changed it to ninety-nine through the pointer. Same memory, two ways to access it.
Student code: https://github.com/GoCelesteAI/c-in-100-seconds/tree/main/episode17
What You'll Learn:
• int *ptr — declaring a pointer
• &x — getting the memory address of a variable
• *ptr — dereferencing, following the pointer to the value
• Writing through a pointer changes the original variable
• %p format specifier for printing addresses
Next: Episode 18 — Pointer Arithmetic
#c #programming #100seconds #learnc #pointers #dereference #ampersand #memory #address #tutorial
Tags
c pointers, pointer dereference c, ampersand address c, star pointer c, memory address c, int pointer, c tutorial 2026, c beginner, 100 seconds,
learn c, coding tutorial
Tags
c pointerspointer dereference campersand address cstar pointer cmemory address cint pointerc tutorial 2026c beginner100 secondslearn ccoding tutorial