Welcome To Golang By Example

Menu
  • Home
  • Blog
Menu

Default Zero Value of Pointer in Go (Golang)

Posted on October 11, 2023October 11, 2023 by admin

Table of Contents

  • Overview
  • Program

Overview

Default zero value of a pointer is nil. Let’s see a program for it

Program

package main
import "fmt"
func main() {
var a *int
fmt.Print("Default Zero Value of a pointer: ")
fmt.Println(a)
}

Output:

Default value of pointer: 
  • go
  • golang
  • Popular Articles

    Golang Comprehensive Tutorial Series

    All Design Patterns in Go (Golang)

    Slice in golang

    Variables in Go (Golang) – Complete Guide

    OOP: Inheritance in GOLANG complete guide

    Using Context Package in GO (Golang) – Complete Guide

    All data types in Golang with examples

    Understanding time and date in Go (Golang) – Complete Guide

    ©2023 Welcome To Golang By Example | Design: Web XP