Re: Re-use the argument?
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Sat, 7 Jun 2008 17:28:56 +0100
"Tomás Ó hÉilidhe" <toe@xxxxxxxxxxx> wrote in message news:
Generally it is considered bad form to modify an argument to a function. It makes things a bit more difficult to read.
Which of these functions would you go with?
unsigned Func(unsigned const x)
{
return 3*x - 2;
}
or:
unsigned Func(unsigned x)
{
x *= 3;
x -= 2;
return x;
}
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
.
- Follow-Ups:
- Re: Re-use the argument?
- From: Richard
- Re: Re-use the argument?
- From: Richard
- Re: Re-use the argument?
- From: Ben Bacarisse
- Re: Re-use the argument?
- From: Richard Heathfield
- Re: Re-use the argument?
- From: Flash Gordon
- Re: Re-use the argument?
- References:
- Re-use the argument?
- From: Tomás Ó hÉilidhe
- Re-use the argument?
- Prev by Date: Re: Compiling problem
- Next by Date: Re: Compiling problem
- Previous by thread: Re: Re-use the argument?
- Next by thread: Re: Re-use the argument?
- Index(es):
Relevant Pages
|