Acquire ownership
</pre>
</div>

<p>
It is also possible to deal with situations like this using
typemaps--an advanced topic discussed later.
</p>


<H2><a name="Tcl_nn32">37.5 Input and output parameters</a></H2>


<p>
A common problem in some C programs is handling parameters passed as simple pointers.  For
example:
</p>

<div class="code">
<pre>
void add(int x, int y, int *result) {
  *result = x + y;
}
</pre>
</div>

<p>
or perhaps
</p>

<div class="code">
<pre>
int sub(int *x, int *y) {
  return *x+*y;