recipe № 045

Returning vector of vectors from C++ to Java

Sometimes, you want to return more complex structures than String or int. In case of containers, you have to go through all the steps that allow creation and manipulation of objects.

Let’s say you have following data in C++

and you want to return it back to Java. You will have to create

(using JNI calls), fill it and return it back to Java.