Call C Function In Javascript Code With WebAssembly
Create a file GetPrimers.c which has a simple math function. #include <stdio.h> // export the function. #ifdef __EMSCRIPTEN__ #include <emscripten.h> EMSCRIPTEN_KEEPALIVE #endif int compute( int a, int b ) { int ans = 1; for( int i = 0; i < b; ++i ) { ans = ans * a; Read more…