how many arguments we can pass to a function i need it in number plaese any body help me out
Printable View
how many arguments we can pass to a function i need it in number plaese any body help me out
Which function do you have in mind?
You have a lot of basic questions. I think you should go and look up some C++ tutorials online or get a beginner C++ book.
Hi munigantipardhu,
how many arguments we can pass to a function i need it in number plaese any body help me out
Actually there is no limit. You can pass as many as argument you want.
Even in C and C++, you do not have to mention in the Signature of the function.
Ex:
Signature of function could be like this;
int TestFunction ( int total_no_of_argument, ... )
{
//use the total_no_of_argument to iterate through all the arguments
//for this you have to read va_start, va_list and va_arg macros
}
And can call the above function as;
1. TestFunction (5, 1, 2, 3, 4, 5 );
2. TestFunction (10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
3. As many as argument you want
Regards