-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
#include <stdio.h>
int main()
{
char name[200];
fgets(name, 200, stdin);
printf("You entered: %s", name);
return 0;
}
$ emcc test.c -o test.js -s EXPORT_NAME='EmscrJSR_test' -s ENVIRONMENT=web,worker -s FILESYSTEM=1 -s MODULARIZE=1 -s EXPORTED_RUNTIME_METHODS=callMain,FS,TTY -s INVOKE_RUN=0 -s EXIT_RUNTIME=1 -s EXPORT_ES6=0 -s USE_ES6_IMPORT_META=0 -s ALLOW_MEMORY_GROWTH=1
copy the created files test.wasm and test.js into your predelivery folder or drag&drop them into the terminal window. You can now execute the command "test" in the terminal and it should ask you for input.
I've done all, it's working but call a window.prompt in the browser ! is there a way to prompt stdin in xterm terminal ?
James-Oswald
Metadata
Metadata
Assignees
Labels
No labels