Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 221
alaamh Avatar asked Apr 29 '10 07:04

alaamh


People also ask

What does a function declaration do in C?

A function declaration tells the compiler about a function's name, return type, and parameters. A function definition provides the actual body of the function.

What is parameter passing in C?

Parameter passing involves passing input parameters into a module (a function in C and a function and procedure in Pascal) and receiving output parameters back from the module. For example a quadratic equation module requires three parameters to be passed to it, these would be a, b and c.

What is an optional in a function declaration?

Parameter declarations are optional. Functions that take no parameters are written without parentheses. The function body begins with the keyword IS (or AS ) and ends with the keyword END followed by an optional function name.

What happens when you declare a function?

A function declaration tells the compiler about a function name and how to call the function. The actual body of the function can be defined separately. int max(int, int); Function declaration is required when you define a function in one source file and you call that function in another file.

What is a function declaration in C++?

A function declaration tells the compiler about the number of parameters function takes data-types of parameters, and returns the type of function. Putting parameter names in the function declaration is optional in the function declaration, but it is necessary to put them in the definition.

What is a parameter in C programming?

These data values are called as parameters. Parameters are the data values that are passed from calling function to called function. In C, there are two types of parameters and they are as follows... The actual parameters are the parameters that are speficified in calling function.

What is the difference between parameter declaration and function declaration?

Parameter names are not important in function declaration only their type is required, so the following is also a valid declaration −. int max(int, int); Function declaration is required when you define a function in one source file and you call that function in another file.

How to pass parameters from calling function to called function in C?

In C Programming Language, there are two methods to pass parameters from calling function to called function and they are as follows... Call by Value. In call by value parameter passing method, the copy of actual parameter values are copied to formal parameters and these formal parameters are used in called function.


1 Answers

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

like image 86
knittl Avatar answered Sep 28 '22 03:09

knittl