Javier Kohen to Druggitt. Ensign:
On stardate 16-May-97, Paul Druggitt established a sub-space link to All
refering to passing structures to functions.
PD> Can anyone tell me how to pass structures of different sizes to a
PD> function ?
PD> I have tried to pass a void pointer to my function, but cannot access
PD> individual members of the structure to perform comparisons.
Have you tried casting???
Ie:
struct Some {
int any;
};
int foo(void *bar)
{
return ((Some *) bar)->any; /* You can replace that cast with
the corresponding new C++ cast, that I don't remember ;) */
}
Internet: jkohen@tough.com * Fidonet: 4:900/748.3 * Sk-Network: 200:201/201.2
-=[ PGP keyID 3423EAA9 ]=-
... Don't repeat your parents mistakes: use a condom!
-!- CrusherTag 0.02.
--- Terminate 4.00/Pro
4:900/748.3)
---------------
* Origin: The King of The Ring BBS þ +54-1-OFF-LINE þ TLD 0 - 7
|