【发布时间】:2019-12-11 09:27:36
【问题描述】:
目标:
使用类似于 python 中的exec() 函数的某种函数执行一串 c(++) 代码。
python 中的示例:
exec('print("hello world")')
#out:
#hello world
问题:
python中是否有c++版本的exec?
【问题讨论】:
-
C 可以从代码运行系统命令...但是它也可以编译和运行 c 代码字符串...? C 不可解释...
-
如果你想运行系统命令你可以使用system但是C/C++代码必须编译
-
你为什么要做这样的事情?您需要解决的实际问题是什么?
标签: python c++ python-3.x python-exec