Qs about structs and their references WRT C functions and variables

Hasan Aljudy hasan.aljudy at gmail.com
Tue Jan 30 22:18:05 PST 2007



Rick Mann wrote:
> Frits van Bommel Wrote:
> 
>> You could use inout. It's basically a C++ non-const reference.
> 
> Yeah, but it kind of breaks the implied semantics...in this case, the parameter is used as input, and not modified, so the value of the supplied parameter is unaffected by the call.

Why? It *is* modified when you modify it inside the function ..

If my information is correct, the difference between out and inout is:
- "inout" just passes the struct by reference.
- "out" clears the struct before passing it by reference.


More information about the Digitalmars-d-learn mailing list