|
-
Apr 5th, 2011, 07:17 AM
#1
Thread Starter
New Member
Adding JString
Hey there I'm new in this forum. I'm a noob at coding in C++, and I'm trying to code a DLL to be loaded in Java.
There a portion of my code, very simple:
Code:
JNIEXPORT jstring JNICALL Java_test_addString(JNIEnv *obj, jclass, jstring a, jstring b){
jstring c = obj->NewStringUTF((char*)obj->GetStringUTFChars(a,0));
jstring d = obj->NewStringUTF((char*)obj->GetStringUTFChars(b,0));
//...
return c+d;
}
Usually you can add 2 strings with '+' operator. But in this particular case, I'm going off my rocker. Apparently I can't add 2 strings in that way. I would use some enum\integral types, but dunno how to do that.
Hope you can help me.
Thank you for your attention.
-
Apr 5th, 2011, 07:34 AM
#2
Thread Starter
New Member
Re: Adding JString
I found out a solution, only. Shortly I use 'strcat', and it works now.
But is there other ways to do the same thing? I ask.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|