SHARE
TWEET

Untitled

quantumech Apr 23rd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <emscripten.h>
  2. #include <stdio.h>
  3.  
  4. // Method being called by JS
  5. EMSCRIPTEN_KEEPALIVE
  6. int sum_arr(int* arr, int length)
  7. {
  8.     int sum = 0;
  9.  
  10.     for(int i = 0; i < length; i++)
  11.     {
  12.         printf("%d\n", arr[i]);
  13.         sum += arr[i];
  14.     }
  15.    
  16.     return sum;
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top