c - "two or more data types in declaration specifiers "错误是什么意思?

标签 c compiler-errors declaration format-specifiers

#include <stdio.h>
typedef int nt;
void main () {
  long int k;
}

当我在 gcc 中运行上面的代码时,它没有显示任何错误。但是当我运行下面的代码时,它抛出了一条错误消息“声明说明符中的两个或多个数据类型”。

#include <stdio.h>
typedef int nt;
void main () {
  long nt k;
}

谁能解释一下这个错误是怎么回事??

最佳答案

typedef 创建完整 类型。

您不能将 long 和 typedef 组合成一个类型。

关于c - "two or more data types in declaration specifiers "错误是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14700188/

相关文章:

c - 父进程如何验证子进程发送的信号

java - 我在while循环中收到了意外 token

function - GNU C 中的 __attribute__

c - sprintf 与 %*.s 格式说明符一起使用时写入空白字符串

android - 如何将android客户端连接到用C编写的服务器?

使用包装器将 shell 脚本转换为 C 代码

c - 在(旧)C 代码中引用 stderr 会产生错误

c++ - 使用 VC++ 编译生成的 C++ 代码

c++ - 链接和名称修改是如何工作的?

java - 空数组自动初始化内容?