gpt4 book ai didi

c - 函数参数类型的奇怪位置

转载 作者:行者123 更新时间:2023-12-01 01:26:33 26 4
gpt4 key购买 nike

Possible Duplicate:
C function syntax, parameter types declared after parameter list




我浏览了一些C代码,发现了inet_pton函数的定义(在.c文件中):

int
inet_pton(af, src, dst)
int af;
const char *src;
void *dst;
...


有趣的是,函数的参数以我从未见过的方式指定了其类型。在相应的头文件中,照常指定参数类型:

extern int inet_pton (int __af, __const char *__restrict __cp,
void *__restrict __buf) __THROW;


我的问题是:这是某种C技巧吗?是否可以始终在函数范围内定义函数的参数类型?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com