Re: Re-use the argument?
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Sun, 8 Jun 2008 18:38:29 +0100
"Richard" <rgrdev@xxxxxxxxx> wrote in message
"Malcolm McLean" <regniztar@xxxxxxxxxxxxxx> writes:
"Tomás Ó hÉilidhe" <toe@xxxxxxxxxxx> wrote in message news:Generally it is considered bad form to modify an argument to a
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;
}
function. It makes things a bit more difficult to read.
What a load of nonsense. If its not a const its no more than a local variable.
There's a previous thread on the subject
Newsgroups: comp.lang.c
From: Morgan Cheng <mo...@xxxxxxxxxxxxx>
Date: Tue, 19 Jul 2005 09:41:26 +0800
Local: Tues, Jul 19 2005 2:41 am
Subject: Should function argument be changed in function body?
I think this link should lead to it
http://groups.google.com/group/comp.lang.c/msg/3ac943f1b7a6c3c5
--
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?
- References:
- Re-use the argument?
- From: Tomás Ó hÉilidhe
- Re: Re-use the argument?
- From: Malcolm McLean
- Re: Re-use the argument?
- From: Richard
- Re-use the argument?
- Prev by Date: Re: input a string in gcc
- Next by Date: Re: printig effort
- Previous by thread: Re: Re-use the argument?
- Next by thread: Re: Re-use the argument?
- Index(es):
Relevant Pages
|