Ir ponteiro do tipo de retorno

Exemplos de código

0
0

Vá Retornar Ponteiros De Função

// Program to return a pointer from a function
package main
import "fmt"
 func main() {

  // function call
  result := display() 
  fmt.Println("Welcome to", *result)

} 

func display() *string {

  message := "Programiz"

  // returns the address of message
  return &message

}

Em outros idiomas

Esta página está em outros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................