# Default Value Pointer

Saat suatu pointer di inisiasi tapi tidak di deklarasikan value-nya, maka value-nya adalah nil.

## Contoh code

```go
package main

import "fmt"

func main() {
  // declare a pointer variable
  var num *int
  var str *string
  var dec *float64
  var isTrue *bool
  type example struct {
      num *int
      str *string
  }
  e := example{}

  fmt.Println("Value of pointer:", num)
  fmt.Println("Value of pointer:", str)
  fmt.Println("Value of pointer:", dec)
  fmt.Println("Value of pointer:", isTrue)
  fmt.Println("Value of pointer:", e)
}
```

```
Value of pointer: <nil>
Value of pointer: <nil>
Value of pointer: <nil>
Value of pointer: <nil>
Value of pointer: {<nil> <nil>}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rafli-ramadhan.gitbook.io/golang-example-code-by-topic/pointer/default-value-pointer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
