-1

So I'm working on a C++ program that reads binary from a text file. Suppose I want the binary in the text file to become part of the C++ program, so that the protam references it and converts it to code that it runs. How can I go about doing this.

In general, how can I read a different programming language from a text file and make my C++ program utilize it?

4

1 回答 1

1

There are several possibilities: one is loading into memory the executable as-is and jump to it.

Another is to implement a tiny virtual machine that will run your code instruction per instruction. It's not really hard for assembly, but really complex for something like PHP.

You could also just call the interpreter/compiler of your language and let it do its job.

于 2013-01-08T14:21:40.793 回答