我的网站的编译器
我打算建立一个编译c和其他语言程序的算法网站。我想知道是否有现成的工具/库?
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?.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能是错的,但假设你有一个 unix 服务器,你应该已经安装了 gcc 或某种形式的 c 编译器。然后,就像使用 gcc 让服务器端脚本语言访问文件夹、将代码写入文件并编译一样简单。
的操作
;
当然,您需要检查文件是否正确编译,并且按照我所描述的方式进行操作而不采取任何安全措施将是一个巨大的安全漏洞。
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.
<?php shell_exec('gcc filename') ?>
with whatever compiler options you want<?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.