c - 在终端中使用 C 时,哈希符号注释掉代码

标签 c linux shell terminal

我想在linux终端中编写C时使用#include头。 哈希符号会注释掉代码。有什么办法可以解决这个问题吗?

<小时/>

我使用终端将 C 代码写入外板,需要这样的句子:

echo #include "analogout.h" > analogout.c

但是井号 # 将我的代码注释掉。

最佳答案

引用字符串以去除字符的特殊含义:

echo '#include "analogout.h"' > analogout.c

关于c - 在终端中使用 C 时,哈希符号注释掉代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48935295/

相关文章:

c - 如何获取与 TCP 套接字关联的接口(interface)名称/索引?

c - 如何手动将 char **args 连接到 char *args

php - 命令在 putty 中工作正常但在 PHP 中不使用 exec()

c - 如何在 linux C 中获得接口(interface)的最大带宽?

linux - getopt 命令部分解析

shell - 错误 : unexpected end of file (expecting "do") for shell script in Dockerfile

linux - 在 Ubuntu Bash Shell 上使用 read -d 选项

复杂的视频在开始之前需要一个基本的简单测试

c++ - libssh 是否支持 sftp 服务器功能?

c - 当进程使用 shm_open() 时,Linux 内核如何分配内存指针?