c - 从枚举进行非法隐式转换?我究竟做错了什么?

标签 c types enums

我收到错误消息 错误:从“@enum$1main_c**”到“@enum$1main_c*”的非法隐式转换

//example.h
typedef enum {eg_1, eg_2} valType;


//main.c
#include "example.h"
void main(void)
{
 valType *testVal;
while(1)
 {
 read(x,y,*testval);
 }
}

你能告诉我我做错了什么吗?提前致谢

最佳答案

如果这是read来自unistd.h ,它的最后一个参数必须是 size_t ,不是valType .

关于c - 从枚举进行非法隐式转换?我究竟做错了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14195442/

相关文章:

Swift 3 关联值枚举比较语法与 OR (`||` )

c++ - 向 C 风格可变参数列表添加额外参数

c - 如何关闭 C 语言中的指数表示法?

C++ : Swapping template class elements of different types?

HTML5 本地存储和变量类型

c# - MediaTypeFormatter 序列化 web api 中的枚举字符串值

c++ - 为什么多线程更慢?

字符字符串覆盖其他字符串

haskell - 与 TypeApplications 一起使用时,AllowAmbigouslyTypes 有多危险?

java - 控制 Moxy 如何以通用方式序列化和反序列化枚举