how to manually allocate memory in golang code example
Example: how to manually allocate memory in golang
package main
import "fmt"
func main(){
ptr := new(int)
*ptr = 100
fmt.Println("*ptr = ", *ptr)
slice := make([]int, 10) // slice with len(slice) == cap(slice) == 10
for i:=0; i<len(slice); i++{
fmt.Println(slice[i])
}
}