Advertisement
quantumech

Untitled

Apr 23rd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement