0

I'm trying to pass the path to my sd card as a jstring to my C++ code. I want to create a new file in that directory in native code, which requires me to append a filename string to the path string. This is the path string I'm trying to pass:

String path = Environment.getExternalStorageDirectory().getAbsolutePath();

What's the best way to work with jstrings in C++? The fopen() method requires a char*.

Thanks :)

  • I guess I should've been more specific - the problem is appending the filename. With GetStringUTFChars I end up with a const char*. How do I append another string to it? (Sorry I'm a total C noob!) – TheLoftyPieMaster Jun 18 '14 at 16:43
  • In that case, this is what you want: http://stackoverflow.com/questions/1995053/const-char-concatenation – bstar55 Jun 18 '14 at 16:44

0 Answers0