Tom St Denis <> wrote:
> On Jun 7, 8:48Â*am, Borealis <listwo...@gmail.com> wrote:
> > this might be a silly question but I really got stuck here.
> >
> > Suppose I have:
> >
> > struct A {
> > Â* int a;
> > Â* int b;
> > Â* int c;
> > };
> >
> > struct B {
> > Â* int x;
> > Â* int y;
> > Â* struct A z;
> > }
> >
> > struct B params[2];
> >
> > void doSomethingWithParams(struct B* arg)
> > {
> > Â* /* Do something with parameters */
> >
> > }
> >
> > void main(void)
> > {
> > Â* doSomethingWithParams(params[1].&z);
> ¶ms[1].z
> Is what you're after.
But note that this gives you the address of the struct A within
struct B (and not the address of a struct B), so the doSomething-
WithParams() should have a prototype of
void doSomethingWithParams(struct A* arg);
Regards, Jens
--
\ Jens Thoms Toerring ___
\__________________________
http://toerring.de