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 2 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, )
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers