Passing command-line arguments to an emscripten-generated application

安稳与你 提交于 2019-12-07 04:49:41

问题


When a C program is compiled with Emscripten, there is an HTML page generated that will display the results of the program. I was wondering how you could pass command line arguments to the application. For instance, with the original C program it's ./bfs 32 1.


回答1:


I was able to pass command line arguments by adding a line to the generated .html file. Not sure if this is the correct solution but it worked. There's a var Module declared. simply add the following line underneath: arguments: ['32', '1'],



来源:https://stackoverflow.com/questions/23407296/passing-command-line-arguments-to-an-emscripten-generated-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!