Created
June 29, 2018 04:01
-
-
Save hi-manshu/797e9ca85e364fc83b3b08120e93b2bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variableName1 := [n]int{n1,n2,n3} // define an int array with n elements | |
variableName2 := [n]int{n1, n2, n3} | |
// define a int array with n elements, of which the first three are assigned. | |
//The rest of them use the default value 0. | |
variableName3 := [...]int{n4, n5, n6} // use `…` to replace the length parameter and Go will calculate it for you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment