Re: Warning on assigning a function-returning-a-pointer-to-arrays
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Tue, 27 Jun 2006 08:47:52 GMT
spibou@xxxxxxxxx writes:
Keith Thompson wrote:
% cdecl
Type `help' or `?' for help
cdecl> explain int (*pfunc(void))[5]
declare pfunc as function (void) returning pointer to array 5 of int
In fact, I used cdecl myself to figure out how to declare a function
returning an array of int, the reverse of the above:
cdecl> declare p as function (void) returning pointer to array 5 of int
int (*p(void ))[5]
The reverse of what "above" ?
The cdecl "declare" command is the reverse (or inverse, if you prefer)
of the "explain" command.
And what do you mean "function
returning an array..." ? Functions in C don't return arrays.
You're right, of course; I meant "function returning a pointer to an
array", as I wrote in the cdecl "declare" command.
I actually thought I had found a bug in cdecl because it seemed just
too ugly to believe, but when I fed it to my compiler (with high
warning levels), it didn't complain.
I don't find it ugly at all.
Ok.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.
- References:
- Warning on assigning a function-returning-a-pointer-to-arrays
- From: I . M . !Knuth
- Re: Warning on assigning a function-returning-a-pointer-to-arrays
- From: Chris Torek
- Re: Warning on assigning a function-returning-a-pointer-to-arrays
- From: I . M . !Knuth
- Re: Warning on assigning a function-returning-a-pointer-to-arrays
- From: Keith Thompson
- Warning on assigning a function-returning-a-pointer-to-arrays
- Prev by Date: Re: C free
- Next by Date: Re: C free
- Previous by thread: Re: Warning on assigning a function-returning-a-pointer-to-arrays
- Next by thread: Re: Warning on assigning a function-returning-a-pointer-to-arrays
- Index(es):
Relevant Pages
|