의 가치를 포인터프로그램 기능

코드 예제

0
0

에서 포인터프로그램

func main () {
  b := *getPointer()
  fmt.Println("Value is", b)
}
0
0

가 반환에서 포인터 기능

// 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

}

비슷한 페이지

예제가있는 유사한 페이지

다른 언어로

이 페이지는 다른 언어로되어 있습니다

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