passing Strings throught CNI

Jeff Sturm jsturm@one-point.com
Sat Oct 13 09:31:00 GMT 2001


On 2001年10月13日, Wanner Stefan wrote:
> jstring sample::cniString(jstring s){
> jchar *ss= JvGetStringChars(s);
> ss = stlString(ss);
> java::lang::System::out->print(ch);
> return s;
> }

You pass a jchar * to stlString...
> wchar_t* stlString(wchar_t* s){
> wcout << s << " ";
> return s;
> }

...then read it as wchar_t *. Note that jchar and wchar_t are not
equivalent. On my GNU/Linux system, sizeof(wchar_t) == 4.
Jeff


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /