execute C++ from String variable

前端 未结 6 928
北恋
北恋 2020-12-01 21:11

it is possible in C++ to execute the C++ code from string variable. Like in Javascript:

var theInstructions = \"alert(\'Hello World\'); var x = 100\";

var F         


        
6条回答
  •  醉话见心
    2020-12-01 21:44

    You can use Cling as C++ interpreter.

    I created small CMake project for easier Cling integration: C++ as compile-time scripting language (https://github.com/derofim/cling-cmake)

提交回复
热议问题