Translation of C function pointer.

Jonathan M Davis jmdavisProg at gmx.com
Fri Sep 17 17:35:22 PDT 2010


On Friday, September 17, 2010 17:07:15 Simen kjaeraas wrote:
> Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> >> I've always been confused by C in this regard. It seems to logical to me
> >> that T[3] works the same whether T is U[4] or U.
> > 
> > You're going to have to elaborate on that. I'm not quite sure what you're
> > talking about. And the syntax int[4][3] isn't legal C anyway. It just
> > does what
> > C would likely have done had it put the brackets with the type rather
> > than the
> > variable name, since D uses pretty much the same syntax for variable
> > declarations and therefore pretty much the same rules.
> 
> You know, after reading your post to Ali, and trying to come up with a
> reason why I felt the way I did, I have found enlightenment.
> Limited, yes, but I now see that C's order is also good. Now if only
> there were a reasonable way to extricate the type from the variable
> name...

Well, it's easy to get the type in D, but C is not so enlightened. That's what 
happens when you compare languages which have about a 25 year difference in age.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list