Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在同一个文件中结合 Markdown 和 C 预处理器指令。问题是#这在两种语言中都有含义。假设 C 预处理器首先运行,我如何#对 Markdown 标题中使用的任何内容进行换位?
#
尝试用值“#”定义一个 C 预处理器宏。一个例子:
#define HASHMARK # Some text before. HASHMARK 47 != 42 HASHMARK 48 != 42 HASHMARK 49 != 42 Some text after.
示例输出(在 Cygwin 上使用 gcc 4.5.3 预处理):
Some text before. # 47 != 42 # 48 != 42 # 49 != 42 Some text after.
您可能需要对此进行调整,以便间距适合您的应用程序。