Translation of C function pointer.

Simen kjaeraas simen.kjaras at gmail.com
Fri Sep 17 17:07:15 PDT 2010


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...

-- 
Simen


More information about the Digitalmars-d-learn mailing list