Zebra0.com

cpp structuresDeclaring with initial values

Declaring with initial values

The program below uses a struct to declare an variable person which has as members a string name and an int yearBorn. In this example the members of the struct are given an initial value when declared.