in reply to Passing a bytestring from Perl to Inline::C as a 2d array
sub perl_routine { my @array = map { pack "I*", (0) x $x_sz } 1..$y_sz; my $array = pack "P"x@array, @array; c_function( $array, $y_sz, $x_sz ); } void c_function( char *arg, int y_sz, int x_sz ) { int ** const table = ( int ** )arg; int y, x; for ( y = 0; i < y_sz, y++ ) { for ( x = 0; x < x_sz, x++ ) { ++table[y][x]; } } }
It's odd that P* doesn't work
|
|---|