PD> Can anyone tell me how to pass structures of different
PD> sizes to a function ?
PD> Now, is it possible to write a single function that will
PD> accept ANY structure as a parameter, stating which member
PD> to compare?
PD> I have tried to pass a void pointer to my function, but
PD> cannot access individual members of the structure to
PD> perform comparisons.
pd>...
You function must have some means of knowing the size of the
structure and the data layout within it. A parameter list,
similar to a printf() format string would suffice.
However, since each struct must be defined within the program,
it would be much easier to simply construct your functions to
compare exactly what is required in each required instance.
Function overloading may be used to good purpose in this cause.
> ] People with glass heads shouldn't.. Ummm.. I forgot.........
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)
|