Re: strange call
- From: Richard Heathfield <invalid@xxxxxxxxxxxxxxx>
- Date: Sun, 19 Nov 2006 21:38:51 +0000
Context:
f()[2] = 'x';
Malcolm said:
"Richard Heathfield" wrote...
At the cost of considerable trouble and inconvenience for Kavya, who has
It's a perfectly legal shorthand for:
int *p = f();
p[2] = 'x';
without going to all the trouble and inconvenience of defining a
temporary object p to store the pointer value returned by f.
the unhappy task of reading this code.
Yes. I'm not overly keen on it either, but occasionally I've been guilty of
the equivalent, *strchr(foo, bar) = baz, when I knew for sure that bar
appears in foo. Tsk tsk, as they say...
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
.
- References:
- strange call
- From: Kavya
- Re: strange call
- From: Richard Heathfield
- Re: strange call
- From: Malcolm
- strange call
- Prev by Date: Re: strange call
- Next by Date: Re: How to know how many files are into a directory
- Previous by thread: Re: strange call
- Next by thread: Re: strange call
- Index(es):
Relevant Pages
|