Java calling C++ with JNI: why does the JNIEnv pointer get dereferenced twice?
<p>This code is copied directly from <a href="http://java.sun.com/docs/books/jni/html/objtypes.html#4013" rel="nofollow">http://java.sun.com/docs/books/jni/html/objtypes.html#4013</a></p>

<pre><code>JNIEXPORT jstring JNICALL 
Java_Prompt_getLine(JNIEnv *env, jobject obj, jstring prompt)
{
    char buf[128];
    const jbyte *str;
    str = (*env)-&gt;GetStringUTFChars(env, prompt, NULL);
    if (str == NULL) {
         return NULL; /* OutOfMemoryError already thrown */
    }
     printf("%s", str);
    (*env)-&gt;ReleaseStringUTFChars(env, prompt, str);
    /* We assume here that the user does not type more than
     * 127 characters */
    scanf("%s", buf);
    return (*env)-&gt;NewStringUTF(env, buf);
}
</code></pre>

<p>Why is it neither</p>

<pre><code>env-&gt;GetStringUTFChars(...
</code></pre>

<p>nor</p>

<pre><code>(*env).GetStringUTFChars(...
</code></pre>

<p>?</p>
