I'm trying, using the Inline::CPP
module, to pass two pointers as arguments to a C function but I get the error No typemap for type int *. Skipping void swapPointer(int *, int *)
and I can't figure out what I have to do to achieve my goal.
I would like some help, please.
This is my code:
#!/usr/bin/perl
use Inline CPP;
my $x = 1 ;
my $y = 2 ;
swapPointer(\$x, \$y);
print "X:$x Y:$y" ; # expected: $x => 2 and $y => 1
__END__
__CPP__
void swapPointer(int* a, int* b)
{
int tmp = *a;
*a = *b;
*b = tmp;
}