<snip>....
TM>     int n;
TM>     getnumber(n);
TM>     printf( "The number is %d\n", n );
</snip>

no, but I fully expect to to be able to do this sort of thing

char *mystring;
mystring=getTimeAstring();

printf("the time is %s",mystring);

/* or even this: getTimeAsString(mystring) - where the same happens,
  passing a pointer value=effectively by reference */
  
where the getTimeAsString function mallocs some space for the string
and returns a pointer to the populated string.

The above code doesn't care that mystring may or may not be
initialised...I assumed this is what would be happening with the third
party function BMODCRD -> DOH!


TM> So the C<cardmod> routine was either:
TM>     Poorly documented
TM>     You didn't bother to read the documentation
The docs aren't the best - but it was really just a case of me not
seeing the wood for the tress with regards to the memory allocs going
on.

TM> or even all of the above.  But let's make it work anyway...

Cool - it works :-)

Since writing the mail I'd got round the above errors by rewriting my XSUB to
use temporary C vars as buffers and then return the values in a list by
extending the XS stack....now I'm just stuck between the choice of
the two interfaces ;-P

Thanks for your help

  -=Ian=-


Reply via email to