Re: OT: C declaration syntax Re: generics and arrays and multi-class collections
- From: xen <xen@xxxxxxxxxx>
- Date: Fri, 05 Oct 2007 03:17:54 +0200
On Thu, 04 Oct 2007 16:53:02 -0700, Patricia Shanahan <pats@xxxxxxx>
wrote:
xen wrote:
I don't like the way the variable declarations have their type mixedTake a look at cdecl, e.g. http://www.linuxcommand.org/man_pages/cdecl1.html
with the variable name, that is, a pointer is not char* p, but char
*p, and an array of char ptrs is char *p[], and a ptr to an array is
char (*p)[], but it kinda makes sense because that's also the way
you're going to use the variable.
On the one hand, it makes writing C declarations relatively easy. On the
other hand, the fact that such a program exists implies that C
declaration syntax is confusing.
Patricia
My god, I hadn't even imagined that declarations could be so complex.
void (*signal(int x, void (*y)(int )))(int ) { }
But I'm sure they can be much, much complexer.
.
- Follow-Ups:
- Re: OT: C declaration syntax Re: generics and arrays and multi-class collections
- From: Sherman Pendley
- Re: OT: C declaration syntax Re: generics and arrays and multi-class collections
- References:
- Re: generics and arrays and multi-class collections
- From: xen
- Re: generics and arrays and multi-class collections
- From: Daniel Pitts
- Re: generics and arrays and multi-class collections
- From: xen
- Re: generics and arrays and multi-class collections
- Prev by Date: Re: Can't use JDK 1.4 jar file (javax.crypto) in JDK 1.3
- Next by Date: Re: chopping of string
- Previous by thread: Re: generics and arrays and multi-class collections
- Next by thread: Re: OT: C declaration syntax Re: generics and arrays and multi-class collections
- Index(es):
Relevant Pages
|