No. I was just an example. The general idea is that when you use a structure, it's good design to pass the address of it to the functions.Quote:
Originally Posted by Tyler_Durden
The address can be the address of some object
or the address got from a parameterCode:void fa (void)
{
T o;
fb (&o);
}
or from malloc():Code:void fa (T *po)
{
fb (po);
}
Code:void fa (void)
{
T *po = malloc (sizeof *po);
if (po != NULL)
{
fb (po);
free (po), po = NULL;
}
}