[prev] 28 [next]

Exercise 5: Passing structs by reference

Write a MIPS function that implements:

typedef struct _Person {
   int  id_no;
   char family[15];
   char given[15];
} Person;

void showPerson(Person *p)
{
   printf("%d\n", p->id_no);
   printf("%s", p->family);
   printf("%s", p->given);
}

which might produce output like

5000035 
Shepherd
John