【发布时间】:2013-01-30 12:41:40
【问题描述】:
typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);
据我所知,typedef 为标准库中的类型分配新名称。在这种情况下,*http_data_cb 的实例是一个 int,但 (http_parser*, const char *at, size_t length) 怎么样?
这里是whole code的链接
谢谢,
【问题讨论】:
-
@KingsIndian 它无法识别,它说语法错误
-
因为
http_parser没有定义。可能也是一个类型定义的类型。 -
@wildplasser,与此无关。我尝试通过更改它。如果你不相信我自己试试。
-
我不必尝试。我知道
http_parser在 C 中既不是类型名称也不是关键字。我刚刚检查过:它是一个类型化的不完整类型。 -
我将 http_parser 更改为 int 然后尝试了。
标签: c function-pointers typedef