How does code written in one language get called from another language

后端 未结 7 1812
余生分开走
余生分开走 2021-01-31 06:25

This is a question that I\'ve always wanted to know the answer, but never really asked.

How does code written by one language, particularly an interpreted language, get c

7条回答
  •  死守一世寂寞
    2021-01-31 07:05

    Typically the C++ code will invoke an interpreter for the scripting language. The degree of interaction between the compiled and scripting code is dependent on the interpreter but there's always a way to pass data between the two. Depending on the interpreter, it may be possible to manipulate the objects on one side from the other side, such as a C++ function calling a method on a Ruby object. There may even be a way to control execution of one from the other.

提交回复
热议问题