c - 为什么 Linux C API 'open' 支持函数重载?

标签 c linux api overloading

<分区>

根据 the Linux manual page , Linux C API open 有两个原型(prototype)如下:

int open(const char *pathname, int oflags);
int open(const char *pathname, int oflags, mode_t mode);

让我困惑的是:

为什么 Linux C API 'open' 支持函数重载?

最佳答案

不,C 不支持函数重载。

POSIX open function 实际上是一个可变参数函数,它的签名是:

int open(const char *path, int oflag, ... );

关于c - 为什么 Linux C API 'open' 支持函数重载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30057566/

相关文章:

c - 编写一个重新排列链表的函数,将偶数位置的节点放在列表中奇数位置的节点之后

c - C中字符数组输入输出问题

linux - 在bash中使用sed写入变量指定的行号

linux - 终止使用 system() 启动的进程

javascript - 将 API key 设置为 XMLHttpRequest 的 header

c - 在c中绘制三角形

c - Cortex-M7 的 DS-5 配置

linux - 了解 tar 和 ssh 备份

api - 将护照身份验证集成到 Lumen 中

python - 如何使用libsvm中svm_model的 'predict'函数?