mirror of
				https://github.com/SourceFellows/gobuch.git
				synced 2025-11-04 15:46:17 +01:00 
			
		
		
		
	initial import
This commit is contained in:
		
							
								
								
									
										14
									
								
								golang-language-samples/pointer-struct/pointer.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								golang-language-samples/pointer-struct/pointer.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
package main
 | 
			
		||||
 | 
			
		||||
import "fmt"
 | 
			
		||||
 | 
			
		||||
type Person struct {
 | 
			
		||||
	Name string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
	p := &Person{}
 | 
			
		||||
	p.Name = "Kristian"
 | 
			
		||||
	(*p).Name = "Kristian" //beide Zeilen sind gleichbedeutend
 | 
			
		||||
	fmt.Println(p)
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user