How to call a C/C++ function from a Java method - simplified explanation
Channel: Hoven
Date: 2020-08-16

for details see also the article https://blog-hoven.appspot.com/cpp-core/call-cpp-from-java.html

This video explains how to call a c++ function from a java method. We explain how to compile a dll and then use two approaches to call the function.

this is the code you may be looking for - 

extern "C"
{

    __declspec (dllexport) void __stdcall Java_CMyClass_myMethod()
    {

        printf("Hello from C++");

    }

}