gpt4 book ai didi

html - 如何在html中显示c++代码?

转载 作者:太空狗 更新时间:2023-10-29 20:12:25 25 4
gpt4 key购买 nike

<pre> 一起使用时标签仍然没有显示 <iostream.h> , <conio.h>和其他包含 <> 的关键字尖括号,如“cout<<”。我只想知道如何在网页上显示我的编码。 (没有编译,没有语法高亮)

最佳答案

您需要替换 <>和他们的 HTML character entity等效项:&lt;&gt; .

例如:

<pre>
&lt;iostream.h&gt;
&lt;conio.h&gt;
cout&lt;&lt;
</pre>

关于html - 如何在html中显示c++代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27782569/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com