Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does ... mean in an argument list in C?

Tags:

c

I came across the following function signature and I wondered if this (the ellipsis, or "...") is some kind of polymorphism?

#include <fcntl.h> int fcntl(int fd, int cmd, ... ); 

Thanks in advance.

like image 294
Anonymous Avatar asked Jul 14 '09 09:07

Anonymous


People also ask

What is an argument list in C?

va_list is like any other type. For example, the following code declares a list that can be used to store a variable number of arguments. 1. va_list a_list; va_start is a macro which accepts two arguments, a va_list and the name of the variable that directly precedes the ellipsis ("...").

What is meant by argument list?

ARGUMENT LIST. A list of cases put down for the argument of some point of law.

What does it mean to have & in parameter?

It means a reference to a pointer to an int. In other words, the function can change the parameter to point to something else.

What is argument list in printf?

printf is a "variadic" function. This means that the argument list is declared with ... on the end, and in the implementation of printf the va_list , va_start , va_arg etc macros are used to extract the arguments from the variable length list.


1 Answers

It's a variable argument list.

like image 70
uniquesnowflake8 Avatar answered Sep 30 '22 23:09

uniquesnowflake8