C Programming - Variable Number of Arguments - Discussion
Discussion Forum : Variable Number of Arguments - Yes / No Questions (Q.No. 2)
2.
While defining a variable argument list function we drop the ellipsis(...)?
Discussion:
11 comments Page 1 of 2.
Jass said:
6 years ago
Suppose, we have a function:
int fun(int a,int b)
When the function is called as:
fun(2,3,4)
C compiler will give the error "Too many arguments to function".
To resolve this error, C offers a feature called ellipsis () by which we are able to pass a variable number of arguments.
Hence the prototype of printf() is:
int printf (const char *str, )
int fun(int a,int b)
When the function is called as:
fun(2,3,4)
C compiler will give the error "Too many arguments to function".
To resolve this error, C offers a feature called ellipsis () by which we are able to pass a variable number of arguments.
Hence the prototype of printf() is:
int printf (const char *str, )
Jass said:
6 years ago
Suppose, we have a function:
int fun(int a,int b)
When the function is called as:
fun(2,3,4)
C compiler will give the error "Too many arguments to function".
To resolve this error, C offers a feature called ellipsis () by which we are able to pass a variable number of arguments.
Hence the prototype of printf() is:
int printf (const char *str, )
int fun(int a,int b)
When the function is called as:
fun(2,3,4)
C compiler will give the error "Too many arguments to function".
To resolve this error, C offers a feature called ellipsis () by which we are able to pass a variable number of arguments.
Hence the prototype of printf() is:
int printf (const char *str, )
Mary said:
9 years ago
@Rob.
Even I do agree with you. Good job Rob.
Even I do agree with you. Good job Rob.
Gunz said:
9 years ago
@Vishnupriya.
According to me, Ellipse is an oval like geometrical shape. But I don't know it's meaning in C language.
According to me, Ellipse is an oval like geometrical shape. But I don't know it's meaning in C language.
Vishnupriya said:
9 years ago
It's very confusing.
What is ellipsis can anybody explain it in detail?
What is ellipsis can anybody explain it in detail?
Rob said:
1 decade ago
I believe the question here should read:
"While defining a variable argument list function we ADD the ellipsis(...)?
As it is written, the sentence claims we can leave out the ellipsis when defining the function. I do not believe the writer of the question understands the meaning of the word "drop" in this situation.
"While defining a variable argument list function we ADD the ellipsis(...)?
As it is written, the sentence claims we can leave out the ellipsis when defining the function. I do not believe the writer of the question understands the meaning of the word "drop" in this situation.
Subham said:
1 decade ago
How can we make a function with variable arguments after dropping ellipses?
(1)
Abhimanyu Nagrath said:
1 decade ago
@Naresh.
void fun(int,...);at the time of declaration of the function with variable argument the three (...) that are passed for variable list is known as ellipsis(...).
void fun(int,...);at the time of declaration of the function with variable argument the three (...) that are passed for variable list is known as ellipsis(...).
Anu said:
1 decade ago
Variable argument list function contain diffrent-2 types of argumennt so by using ellipsis(...) we replace that type of function.
Kavita said:
1 decade ago
Can anybody explain this ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers