← BYTES
Go·Starter·Ref: 10.1.5

What does a declared-but-uninitialized pointer variable hold as its zero value?

Have a question about this video? Mention reference 10.1.5 when you contact us.

a.A pointer to a newly allocated zero-valued object
b.nil
c.0 (treated as a plain integer)
d.A compile-time error forcing explicit initialization
Pointer types (along with slices, maps, channels, functions, and interfaces) have nil as their zero value -- dereferencing a nil pointer panics at runtime with a nil pointer dereference, since it points to no valid memory address.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES1015#Go