www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D declaration docs

reply me <me_member pathlink.com> writes:
From the docs:
"""
Declaration syntax generally reads right to left:

int x;		// x is an int
int* x;		// x is a pointer to int
int** x;	// x is a pointer to a pointer to int
int[] x;	// x is an array of ints
int*[] x;	// x is an array of pointers to ints
int[]* x;	// x is a pointer to an array of ints


Arrays, read left to right:

int[3] x;	// x is an array of 3 ints
int[3][5] x;	// x is an array of 5 arrays of 3 ints
int[3]*[5] x;	// x is an array of 5 pointers to arrays of 3 ints
"""

To me, that's still "right to left"! :-)




Also, this sounds funny (at least to me!):

"""
In a declaration declaring multiple declarations, all the declarations must be
of the same type:"""
May 07 2005
parent "Walter" <newshound digitalmars.com> writes:
Good catch, I'll take care of it.
May 08 2005