Afficher un message
Vieux 06/02/2008, 02h01   #14
Richard Tobin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Neatest way to get the end pointer?

In article <foav6k$pfa$1@canopus.cc.umanitoba.ca>,
Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca> wrote:

>> if (some_test_fails)
>> return (errno = ESOMETHING), (void *)NULL;


>No, if the return type of your function is a pointer then the
>return value will be converted to the appropriate type as if by
>assignment.


But the code is revolting anyway. I can see the temptation to
do something like

if(condition) a=1, b=2;

to avoid a block, but shoving an extra assignment into a return
statement is an unprovoked assault on readability.

-- Richard
--
:wq
  Réponse avec citation
 
Page generated in 0,05193 seconds with 9 queries