postfix indirection
Wayne Throop
throopw at sheol.UUCP
Fri Nov 17 05:45:46 AEST 1989
- peter at ficc.uu.net (Peter da Silva)
- [...] I wish indirection was postfix. In
- "My Ideal C" this would be !p^[i][j][k]!.
- (I'm going to start a C-FUTURES mailing list soon, for discussions of
- this nature. Mail to peter at ficc.uu.net if you want to join.)
Hmmmmm. Why wait for the future? I use the standard postfix indirection
operator for these cases, "[0]". (Of course, you still have to declare
pointers funny, but you can dereference 'em postfix.) Peter's example
becomes:
p[0][i][j][k]
instead of
(*p)[i][j][k]
(Golly, even the same number of characters...)
No, seriously folks, I actually do do this to pointers sometimes when
I "want postfix indirection". It can make stuff easier to read.
Sometimes.
--
Wayne Throop <backbone>!mcnc!rti!sheol!throopw or sheol!throopw at rti.rti.org
More information about the Comp.lang.c
mailing list