Path: utzoo!utgpu!news-server.csri.toronto.edu!me!zougas Newsgroups: comp.lang.c From: zougas@me.utoronto.ca ("Athanasios(Tom) Zougas") Subject: Re: Addressing struct without -> Message-ID: <91Feb1.172318est.21150@me.utoronto.ca> Organisation: U of Toronto, Dept. of Mechanical Engineering Organization: Mechanical Engineering, U of Toronto References: <91010.084408NIBMSCM@NDSUVM1.BITNET> Date: 1 Feb 91 22:23:38 GMT wolfram@cip-s02.informatik.rwth-aachen.de (Wolfram Roesler) writes: >NIBMSCM@NDSUVM1.BITNET writes: >> ...Pascal, I had the capability to use >>the 'using' keyword, giving the address of a structure and then address >>the elements of that structure without the necessity of using the >>ptr->element notation (could simply use element). >#define X ptr->fooptr->foo.bar.bar.baz.foobar->foobaz.x >and now write > X->something >instead of (well you know what). Personally, I hate these types of "magic" defines. Why not just use: X = ptr->fooptr->foo.bar.bar.baz.foobar->foobaz.x and the access the elements within using: X.element where X is of the proper type. This also saves on all those indirections. Tom. -- I can be reached at... zougas@me.utoronto.ca || zougas@me.toronto.edu || ...!utai!me!zougas