From: Shyan Lam [mailto:[EMAIL PROTECTED]
> From: Michael White [mailto:[EMAIL PROTECTED]
>> Is someone looking to increase the speed of a program, or
>are they trying
>> to save memory?
>> Forgive me if my observation is incorrect, as I am a new programmer
>myself.
>>
>> As I think of it, when you pass a variable by value to a
>function, you are
>> having to make another copy of the value thus taking up more space in
>> memory for the duration of the function.
>
>Same as pointer, A copy of the address is passed.
>
>Consider the following two variations:
> 1. int foo(const int i) { return i * i; }
> 2. int foo(const int * const pi) { return *pi * *pi; }
>
>What gain do you have by passing address instead of a copy?
The ability to modify the passed in data.
[snip]
--
PJH
bug, n: An elusive creature living in a program that makes it incorrect.
The activity of "debugging", or removing bugs from a program, ends when
people get tired of doing it, not when the bugs are removed. -
"Datamation", January 15, 1984
Alderley plc, Arnolds Field Estate, The Downs, Wickwar, Gloucestershire, GL12
8JD, UK
Tel: +44(0)1454 294556 Fax: +44 (0)1454 299272
Website : www.alderley.com Sales : [EMAIL PROTECTED] Service : [EMAIL
PROTECTED]
This email and its contents are confidential and are solely for the use of the
intended recipient. If you are not the original recipient you have received it
in error and any use, dissemination, forwarding, printing or copying of this
email is strictly prohibited. Should you receive this email in error please
immediately notify [EMAIL PROTECTED]
This email has been scanned for viruses, however you should always scan emails
with your own systems prior to opening.
>-----------------------------------------~-~>
CHECK THE ARCHIVE BEFORE POSTING!!!! Archive is available at
http://www.eScribe.com/software/C-Paradise/
>------------------------------------------_->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/C-Paradise/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/