Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
498 views
in Technique[技术] by (71.8m points)

syntax - In a C function declaration, what does "..." as the last parameter do?

Often I see a function declared like this:

void Feeder(char *buff, ...)

what does "..." mean?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

you have to access them with va_start, va_arg and va_end

see http://publications.gbdirect.co.uk/c_book/chapter9/stdarg.html for more information


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...