在 C 函数声明中,“..."是什么意思?作为最后一个参数做什么? [英] In a C function declaration, what does "..." as the last parameter do?

查看:21
本文介绍了在 C 函数声明中,“..."是什么意思?作为最后一个参数做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常看到这样声明的函数:

Often I see a function declared like this:

void Feeder(char *buff, ...)

..."是什么意思?

推荐答案

它允许可变数量的未指定类型的参数(就像 printf 那样).

it allows a variable number of arguments of unspecified type (like printf does).

您必须使用 va_startva_argva_end

http://publications.gbdirect.co.uk/c_book/chapter9/stdarg.html 了解更多信息

这篇关于在 C 函数声明中,“..."是什么意思?作为最后一个参数做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆