next up previous
Next: Source code Up: altruism Previous: Altruism and group selection

Subsections

Data Structures

Defining and declaring structures

Accessing the members

More complex structures

Exercises

  1. Create (define) a structure struct time, whose members are three integers, corresponding hour, minute, and second.
  2. Make a function TimeIntvl() which takes two variables of struct time as the arguments, and returns the difference between the two time in seconds.
  3. Can you modify this function, so it takes two pointers to struct time as the arguments?


next up previous
Next: Source code Up: altruism Previous: Altruism and group selection
Naoki Takebayashi 2006-04-05