SWIG/Examples/ruby/pointer/

Simple Pointer Handling

$Header: /cvsroot/SWIG/Examples/ruby/pointer/index.html,v 1.1 2000/09/18 13:21:26 fukusima Exp $

This example illustrates a couple of techniques for handling simple pointers in SWIG. The prototypical example is a C function that operates on pointers such as this:

void add(int *x, int *y, int *r) { 
    *r = *x + *y;
}
By default, SWIG wraps this function exactly as specified and creates an interface that expects pointer objects for arguments. The only problem is how does one go about creating these objects from a script?

Possible Solutions

Example

The following example illustrates the use of these features for pointer extraction.

Notes