Bruce Vining wrote:

I disagree (kinda). The iconv() API is documented in the Information Center
using a C style prototype. As the call interface is documented using C
conventions I believe it is very helpful (dare I say essential) to know that
the API expects the documented parameter to be passed by value.

The caller certainly needs to know the capabilities of the calling language
and that passing a pointer to X by value is equivalent to passing X passed
by reference, but knowing how to (correctly) call the API in the first place
is rather important.


I agree that it's absolutely critical to know that the first parameter for iconv() is passed by value.

I'm just quibbling that in general it's usually helpful to think of "type*" parameters in C as being "type passed by reference" rather than "pointer to type passed by value". Even when coding in C, it's important to know when the caller can modify the value, and for me at least, "passing a pointer to this variable" doesn't express that concept as immediately as "passing this variable by reference" does. When I code my_fn(&my_var), I don't actually think "I'm passing this address", I think "I'm passing this variable by reference".

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.