How can a called function determine the number of arguments that have been passed to it?



How can a called function determine the number of arguments that have been passed to it?..

Answer / Deepak Kumar Giri

In C++, you cannot directly get the number of arguments passed to a function because functions are statically scoped. However, you can use variable-length argument lists (also known as varargs) to achieve this flexibility. To implement varargs, you can use the ellipsis (...) operator in the function declaration and process the arguments using va_arg(3).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.

1 Answers   Nucleus, TCS,


what is c++

1 Answers  


What are vectors used for in c++?

1 Answers  


Types of storage and scope of each type

2 Answers   CA,


Can we have "Virtual Constructors"?

10 Answers   TCS,


Can turbo c++ run c program?

1 Answers  


Explain the difference between static and dynamic binding of functions?

1 Answers  


what are the iterator and generic algorithms.

1 Answers  


How do I use turbo c++?

1 Answers  


Which is better turbo c++ or dev c++?

1 Answers  


What is the use of object in c++?

1 Answers  


Do class declarations end with a semicolon? Do class method definitions?

1 Answers  


Categories