WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Go - Array of pointers

You can define arrays to hold some of suggestions.

let us keep in mind the following example, which makes use of an array of two integers
package deal principal

import "fmt"
 
const MAX int = 2
 
func essential() 
   a := []int100,one thousand,200
   var i int

   for i = 0; i < MAX; i++ 
      fmt.Printf("Value of a[%d] = %dn", i, a[i] )
   

When the above code is compiled and carried out, it produces the following end result
Value of a[0] = one hundred
Value of a[1] = one thousand

which could store suggestions to an int or string or another facts type available

This pronounces ptr as an array of MAX integer suggestions. Thus, every detail in ptr, now holds a pointer to an int cost. The following instance uses three integers, so that you can be stored in an array of hints as follows

bundle primary

import "fmt"
 
const MAX int = four
 
func essential() 
   a := []intone hundred,one thousand,2000,3000
   var i int

   for i = zero; i < MAX; i++ 
      fmt.Printf("Value of a[%d] = %dn", i, a[i] )
   


When the above code is compiled and finished, it produces the subsequent result
Value of a[0] = one hundred
Value of a[1] = 1000
Value of a[2] = 2000
Value of a[3] = 3000