Reputation: 559
Does anyone know for a tool that allows a c executable to be run in the browser? I'm looking for a javascript, java, or flash solution because I don't have privileges to run c executables on the server.
The executables are basic input and output programs.
Upvotes: 0
Views: 110
Reputation: 204886
Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode (which can be generated from C/C++, using llvm-gcc or clang, or any other language that can be converted into LLVM) and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run).
Using Emscripten, you can
- Compile C and C++ code into JavaScript and run that on the web
- Run code in languages like Python as well, by compiling CPython from C to JavaScript and interpreting code in that on the web
Upvotes: 0
Reputation: 70557
Looking at your comments, I hear you mention students and running simple programs. As a suggestion, you might want to look into CodePad. This will let you interpret simple C programs. Note that everything needs to be in one place, so you'll have to combine C and header files.
Here is a sample:
EDIT
Here's another one I found:
When you run the program, at the bottom there is a link for input. You can use it to run the program with given input as entered.
Upvotes: 1
Reputation: 215397
You could use this as a basis for solving the problem:
Upvotes: 0