Top "Variadic-functions" questions

A function is variadic if it can accept a variable number of arguments; that is, its arity is not fixed.

varargs and the '...' argument

Consider the method declaration: String.format(String, Object ...) The Object ... argument is just a reference to an array of Objects. …

java arrays parameters variadic-functions
How to create variable argument methods in Objective-C

Maybe this will be obviously simple for most of you, but could you please give an example how to create …

objective-c xcode format variadic-functions null
Java varargs method param list vs. array

Varargs: public static void foo(String... string_array) { ... } versus Single array param: public static void bar(String[] string_array) { ... } Java 1.6 …

java variadic-functions
What is the purpose of the h and hh modifiers for printf?

Aside from %hn and %hhn (where the h or hh specifies the size of the pointed-to object), what is the …

c printf variadic-functions promotions format-specifiers
Ruby method with maximum number of parameters

I have a method, that should accept maximum 2 arguments. Its code is like this: def method (*args) if args.length &…

ruby variadic-functions
How can I format a std::string using a collection of arguments?

Is it possible to format std::string passing a set of arguments? Currently I am formatting the string this way: …

c++ string-formatting stdstring variadic-functions
Passing an ellipsis to another variadic function

I have approximately 30 variadic functions. Each one accepts a path as the final argument, e.g.: bool do_foo(struct *…

c variadic-functions
PHP Spread Syntax in Array Declaration

PHP supports the spread syntax for variadic functions. In JavaScript, you can use the spread syntax to do this: var …

php arrays variadic-functions spread-syntax
Calling Java varargs method with single null argument?

If I have a vararg Java method foo(Object ...arg) and I call foo(null, null), I have both arg[0] …

null language-design java variadic-functions
How to pass Scala array into Scala vararg method?

Consider the code below: private def test(some:String*){ } private def call () { val some = Array("asd", "zxc") test(some) } It …

arrays scala variadic-functions