是否可以从文件C#运行C ++或C代码 [英] Is it possible to run C++ or C codes from a file C#

查看:217
本文介绍了是否可以从文件C#运行C ++或C代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



C#中是否可以执行在.txt文件中读取的C ++或C代码流?

如果不是,为什么?

如果是,有什么要求这样做。



谢谢

Hi guys.

Is it possible in C# to execute stream of C++ or C codes that was read in a .txt file?
If No, why?
If Yes, what are the requirements to do this.

Thanks

推荐答案

是的,这是可能的。



如果没有相当多的工作,这是不切实际的。

您可以通过使用现有的C / C ++编译器来编译代码,链接它并运行可执行文件,但坦率地说这是一个令人讨厌的工作,有点混乱,特别是如果有任何错误来源,或者你想将自己的价值/代码整合到其中。



另一个解决方案是在网上编写或找到一个C / C ++编译器/解释器并尝试 - 但同样,这是一个混乱的工作,可能只会导致更多的问题而不是它解决。



你想要实现什么,你认为这是个好主意?
Yes, it is possible.

No it isn''t practical without a fair amount of work.
You could do it by using an existing C/C++ compiler of compile the code, link it, and run teh rsulting executable, but frankly it''s a nuisance job, and kinda messy, particularly if there are any errors in teh source, or you want to integrate you own values / code into it.

The other solution is to write or find a C/C++ compiler/interpreter on the web and try that - but again, it''s a messy job that probably just causes more problems than it solves.

What are you trying to achieve, that you think this is a good idea?


这篇关于是否可以从文件C#运行C ++或C代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆