How to declare array without specify the size in Go

1 Answer

0 votes
package main
 
import "fmt"
 
func main() {
    arr := [...]string{"go", "java", "php", "c", "c++", "python", "c#", "javascript"}
 
    fmt.Printf("%v\n", arr)
}
 
 
 
/*
run:
    
[go java php c c++ python c# javascript]
  
*/

 



answered Aug 10, 2020 by avibootz
edited Aug 10, 2020 by avibootz

Related questions

1 answer 163 views
1 answer 123 views
1 answer 111 views
1 answer 148 views
1 answer 103 views
1 answer 156 views
...