Created
July 1, 2014 18:14
-
-
Save bolilla/a27809f03afc25a9ec94 to your computer and use it in GitHub Desktop.
GoPadawan PtrArrSlice Array Func
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
package main | |
import "fmt" | |
func main() { | |
var arrayDeDiezEnteros [10]int | |
fmt.Println("Este es tu array al principio, pequeño padawan:", arrayDeDiezEnteros) | |
cambiarPosiciones(arrayDeDiezEnteros) | |
fmt.Println("Este es tu array al final, pequeño padawan:", arrayDeDiezEnteros) | |
} | |
func cambiarPosiciones(array [10]int) { | |
fmt.Println("Este es el array al principio de la función: ", array) | |
array[3] = 42 | |
fmt.Println("Este es el array al final de la función: ", array) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment