Hi,
I am planning to build an algorithm web site that compiles the c and other language programs. I want to know is there any readymade tools/libraries for that?.
From stackoverflow
santhosh
-
I may be mistaken, but assuming you have a unix server, you should have gcc or some form of c compiler already installed. Then, it's as simple as getting your server side scripting language access to the folder with gcc, writing the code to a file, and compiling.
- Write the code to a file.
- Do something like
<?php shell_exec('gcc filename') ?>with whatever compiler options you want - Execute the progam -
<?php echo shell_exec('compiled_filename') ?>
Of course, you'll want to check that the file compiled properly, and doing it as I described without any security measures is a huge security hole.
From Sam Dufel
0 comments:
Post a Comment