how do i write function that accepts unlimited arguments?
i know in java we write it in this way funcName(int ...) ..so what's the way to write it in C++

Recommended Answers

This article might be a good place to start.

Jump to Post

All 3 Replies

Also, look at this: http://www.cprogramming.com/tutorial/lesson17.html

Variable arguments have been in use for decades. This technique is pretty standard for processing (...) arg lists. FWIW, the printf() functions use this internally.

is that the only way to do that ? ..i do alot of searching but i cant figure it out exepect this way by using <cstdarg.h>..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.