title: JNI pass parameters to method of c++
body: <p>I have a c++ file myCppTest.cpp which has method </p>
  
  <pre>
  int myFunction(int argv, char **argc) {
  }
  </pre>
  
  <p>and 
  a Java native method in myClass.java</p>
  
  <pre>
  public native int myFunction (int argv, char[][] argc);
  </pre>
  
  <p>After generate the header file using javah -jni myClass, i have the header</p>
  
  <pre>
  JNIEXPORT jint JNICALL Java_JPTokenizer_init
    (JNIEnv *, jobject, jint, jobjectArray);
  </pre>
  
  <p>In my myClass.cpp, I defined </p>
  
  <pre>
  JNIEXPORT jint JNICALL Java_JPTokenizer_init
    (JNIEnv *env, jobject obj, jint argv, jobjectArray argc) {
          //need to call int myFunction(int argv, char **argc) in myCppTest.cpp 
  }
  </pre>
  
  <p>How could I pass the arguments "jint argv, jobjectArray argc" to "int argv, char **argc", thanks.</p>
  
  <p><B>EDIT: <P>I THINK I MADE A MISTAKE</P>
  The Java native method in myClass.java should be</p>
  
  <pre>
  public native int init (int argv, char[][] argc);
  </pre>
  
  <p>So there is </p>
  
  <pre>
  JNIEXPORT jint JNICALL Java_myClass_init
    (JNIEnv *, jobject, jint, jobjectArray);
  </pre>
  
  <p>generated after javah.
  And in myClass.cpp, i have</p>
  
  <pre>
  JNIEXPORT jint JNICALL Java_myClass_init
    (JNIEnv *env, jobject obj, jint argv, jobjectArray argc) {
          //need to call int myFunction(int argv, char **argc) in myCppTest.cpp 
  }
  </pre>
  
  <p></B></p>