Created
December 30, 2017 04:33
-
-
Save kyorohiro/3e762287511a3c9e40246303c070f4cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ emcc libsqrt.c | |
#include <math.h> | |
int int_sqrt(int x) { | |
return sqrt(x); | |
} | |
$ emacs main.c | |
#include<stdio.h> | |
int int_sqrt(int x); | |
int main(int argc, char** argv) { | |
printf("%d\r\n", int_sqrt(2)); | |
} | |
$ emcc main.c libsqrt.c | |
$ node a.out.js | |
1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment