How to run c++ code from c++?

前端 未结 5 1632
夕颜
夕颜 2021-01-24 02:03

If I have some c++ code as a string quantity (data) in a c++ program, can I execute the contents of that string?

As using the CodeDOM in C# or the eval function present

5条回答
  •  独厮守ぢ
    2021-01-24 02:34

    No. As C++ is a static language, you can not dynamically eval arbitrary code.

    You could interpret it or even compile and run it seperately as Keith suggested

提交回复
热议问题