【问题标题】:what is the weird usage in C language [duplicate]C语言中有什么奇怪的用法[重复]
【发布时间】: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);
    //.........
}

【问题讨论】:

标签: c


【解决方案1】:

这是旧的 K&R 函数声明风格,被您可能更熟悉的 ANSI 风格所取代。另见Function declaration: K&R vs ANSI

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-14
    • 2021-01-12
    • 2021-05-11
    • 2011-05-21
    • 1970-01-01
    • 1970-01-01
    • 2013-07-16
    • 1970-01-01
    相关资源
    最近更新 更多