Re: Perl to C++, pass by reference parameters on a method

[email protected] (Dominique Dumont)
Newsgroups perl.xs
Message-ID <[email protected]>
On Monday 08 August 2011 16:21:09 Nikola Viktorov wrote:
>         cout << "[C++] what was received: " << endl;
>          sv_dump(ST(1));
> 
>         sv_setref_pv(ST(1), NULL, (void *) 4545);
>         cout << "[C++] after the new value was set: " << endl;

This is not correct. You need to read the ref value from ST(1) and then assign 
to this ref.

Something like:

sv_setref_iv(  SvRV( ST(1) ) , NULL, 4545) ;

(I've made this untested line from an old copy of "Advanced Perl Programming", 
so the syntax may differ slightly).

HTH

Dominique
--
http://config-model.wiki.sourceforge.net/ -o- http://search.cpan.org/~ddumont/
http://www.ohloh.net/accounts/ddumont     -o- http://ddumont.wordpress.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.