更新时间:2023-11-17 18:13:10
的C / C ++ preprocessor行为在令牌单位,一个字串是的单的标记。因此,你不能在一个字符串一样,中间的干预。
The C/C++ preprocessor acts in units of tokens, and a string literal is a single token. As such, you can't intervene in the middle of a string literal like that.
您可以preprocess script.py成类似:
You could preprocess script.py into something like:
"some code\n"
"some more code that will be appended\n"
和的#include的,但是。或者你可以使用 XXD
-i
来生成一个C静态数组准备列入。
and #include that, however. Or you can use xxd
-i
to generate a C static array ready for inclusion.