c - 当我在 Mac OS X 上编译它时,它正在考虑引号 ("%d") 作为未定义的 ascii 符号

标签 c macos double-quotes

例如。当我写这个时-> scanf(“%d”,&newnode->x);

错误是,

list.c:18:7: error: non-ASCII characters are not allowed outside of literals and
      identifiers
scanf(“%d”,&newnode->x);
      ^
list.c:18:10: error: expected expression
scanf(“%d”,&newnode->x);
       ^
list.c:18:12: error: non-ASCII characters are not allowed outside of literals
      and identifiers
scanf(“%d”,&newnode->x);
         ^
list.c:18:11: error: use of undeclared identifier 'd'
scanf(“%d”,&newnode->x);
        ^
4 errors generated.

最佳答案

我相信,您对(unicode quote, U+201C)的预期"(ascii quote, U+0022)有疑问。它们不是真的一样。

你可以详细阅读差异here .

关于c - 当我在 Mac OS X 上编译它时,它正在考虑引号 ("%d") 作为未定义的 ascii 符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45540232/

相关文章:

python - 通过 SSH 命令从 Mac OS X 计算机启动远程脚本

c++ - 如何修复 'Undefined symbols for architecture x86_64: "_get_driver_instance"' 链接器错误

r - 双 ""和单 '' 引号(总是)在 R 中可以互换吗?

xslt - 在 XSLT 中的值周围加上双引号

c - C语言如何在不交换数据的情况下交换链表中的节点?

c - 填写作为指针传递的 vector (C)

c - 如何组织C多文件项目?

c - 切换数据类型 int 的第 100 位会产生意想不到的结果

linux - 一条命令即可判断是 windows、osx 还是 linux/unix

java - 使用java删除另一个双引号内的双引号