Binky Pointer Video

sedthh · 67K views · 2007 · 3:12

Open on YouTube

C, C++, Rust, Go & systems languagesEducation & learningexplainer

Why Stack Overflow recommends it

Stack Overflow users link it as a quick, memorable visual explanation when someone is confused about pointers, dereferencing, or object references.

Recommended by 5 people across 5 different months, 2013 to 2019.

What it is

A three-minute animated clip from Stanford's CS Education Library that introduces pointers through a silly character named Binky. It covers pointer basics, dereferencing, pointees, and common pitfalls, and exists in versions for C, Java, C++, Pascal and Ada. This upload is a re-post of the Stanford original.

What people said

Recommends Khaled Barazi · 2013-02 · Stack Overflow · on “Finding the length of an array in C”

Remember that: while(fl != fl_tails[idx]) is equivalent to: while(fl != *(fl_tails + idx)) so what you are doing is comparing a pointer fl to an actual value since (fl_tails + idx) is a pointer and *(fl_tails + idx) is dereferencing this pointer to get the value it is pointing to. so if you are just comparing pointer addresses to find the end of the array, I would change to: while(fl != &fl_tails[idx]) so that you are comparing pointers to pointers. As far as the values you got, remember that a pointer without a pointee can have a pointee holding an initialized value (some old value from some old program). I recommend seeing this video: [this video]

Recommends sapi · 2013-06 · Stack Overflow · on “Objective-c BOOL always passing”

You shouldn't be using a pointer with a primitive data type. Change BOOL * to BOOL . EDIT: Obligatory link [this video] to a (somewhat ridiculous, but useful) video on pointers.

Recommends Ryan Haining · 2014-04 · Stack Overflow · on “What is the difference between scanf("%d", *p) and scanf("%d", p)?”

*p means go to the place p points to &p means take the address of p , or "get a pointer to" p int i; scanf("%d", &i); // gives scanf a pointer to i int i; int *p = &i; scanf("%d", p); // a more contrived way to say the same thing The obligatory visual explanation is Pointer Fun with Binky [this video] . You can read the types from right to left: int *p => " p has type int * " => p is a pointer to an int int *p => " *p has type int " => *p is the int pointed to by p

Recommends Roy Lee · 2016-05 · Stack Overflow · on “How head.next is changed in singly linkedlist”

how head.next is changed in singly linkedlist ? Short answer : Because initially both first and last are pointing to the same node, last.next = x indirectly causes first.next = x . Long answer : The heart of it is object reference (pointer). To understand why it changed, first you have to understand how pointer works in Java, a very high level language where you are hidden from all the nasty yet tedious memory manipulations. tldr; I would refer you to watch this epic video that talks about pointer, Binky Pointer Video [this video] . How Pointer works in Java 1. Memory allocation: Statement below allocates new memories to hold node values(data & next). x is now holding the address value, i.e: 0x1A

Recommends Frédéric Praca · 2019-08 · Stack Overflow · on “Ada - Nullable type”

@A.Pissicat in C#, as in Java, AFAIK, everything is pointer, even though it's hidden. In Ada, as in C/C++, pointers are different from values (structs, class instances...). If you never used pointers before, this video [this video] might give you an idea of what it is. Then take a look at wikipedia [LINK] )