in reply to Pointer to null terminated string
Update: So now you think it is a point to a scalar? That would be very strange. If the C function wrapped in XS has a return type of SV* (a pointer to a scalar), XS will coerce it to a scalar in perl. Actually, the same is true for char *. The only way to return an actual address to you for a basic type (types XS already has conversions for) is through an int. I'm wondering why anyone would ever want to do this, since perl programmers have little use for addresses.use Inline C => << 'END_OF_C_CODE'; char * return_string (int pnt) { char *str = pnt; return str; } END_OF_C_CODE my $string = return_string($pnt);
|
|---|