tags:

views:

125

answers:

4

I have noticed in Java that you can have a function with object... as a parameter and then method will take any number of objects as a parameter and treat it as an array. What is this called? I have been trying to search for it but it seems ... is ignored by search engines. I seem to remember printf in C does the same thing.

Thanks.

+6  A: 

It's called varargs

Ikke
+2  A: 

It's called varargs

+3  A: 

Wikipedia says this is called a variadic function.

waxwing
+1  A: 

It's called varargs.

It means is function is accepting variable number of arguments. In C/CPP there is a header file stdarg.h which have declaration of methods for handling variable arguments.

GG