【发布时间】:2013-07-10 08:59:33
【问题描述】:
这些天我一直在阅读 dhcpd 源代码,其中有很多这样的用法,我不明白那是什么......
当参数列表和 { 之间的 struct packet *packet; 时发生了什么?
int locate_network (packet)
struct packet *packet;
{
struct iaddr ia;
struct data_string data;
struct subnet *subnet = (struct subnet *)0;
struct option_cache *oc;
if ((oc = lookup_option(&agent_universe, packet->options,
RAI_LINK_SELECT)) == NULL)
oc = lookup_option(&dhcp_universe, packet->options,
DHO_SUBNET_SELECTION);
//.........
}
【问题讨论】:
-
真正的问题是现代编译器仍然可以处理旧式 K&R 函数声明。您正在阅读的代码是否仅具有历史意义?
-
其他重复:What weird C syntax is this?、What is this strange function definition syntax in C?、C statement between function declaration and curly brace、C variable declarations after function heading in definition、Alternate C syntax for function declaration use cases、Why c functions can be defined this way?
-
不,它不只是为了历史利益,我想知道 dhcp 服务器是如何工作的@CodyGray
标签: c