c中省略号运算符是什么

发布于 2024-09-25 01:14:27 字数 282 浏览 0 评论 0原文

可能的重复:
C 中的参数列表中的 ... 是什么意思?

 function fun1(...)
    {
    }

请告诉我c中省略号运算符的用途以及如何使用。 谢谢,

Possible Duplicate:
What's does … mean in an argument list in C ?

 function fun1(...)
    {
    }

Please tell me about what is the use and how to use ellipsis operator in c.
Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老子叫无熙 2024-10-02 01:14:27

省略号用于表示函数的可变数量的参数。例如:

void format(const char* fmt, ...)

上述 C 语言函数可以使用不同类型和数量的参数进行调用,例如:

format("%d-%d-%d", 2010, 9, 25);

format("product: %s, price: %f", "HDD", 450.90);

C99< /a> 引入了 可变参数宏,它也使用了省略号。

An ellipsis is used to represent a variable number of parameters to a function. For example:

void format(const char* fmt, ...)

The above function in C could then be called with different types and numbers of parameters such as:

format("%d-%d-%d", 2010, 9, 25);

and

format("product: %s, price: %f", "HDD", 450.90);

C99 introduced Variadic macros which also makes use of ellipsis.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文