Skip to content

Files

Latest commit

 

History

History

PointerToStruct

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Pointer To Struct

This is a Go program that defines two structs: Person and Address. The Person struct contains fields for a person's name, age, and address. The address field is a pointer to an instance of the Address struct, which contains fields for a street, city, state, and zip code.

In the main function, the program creates a new instance of the Address struct and initializes it with data for a fictional street address. Then creates a new instance of the Person struct and initializes it with data for a fictional person, including a pointer to the Address struct.