Click to See Complete Forum and Search --> : about function


munigantipardhu
February 8th, 2009, 06:17 AM
how many arguments we can pass to a function i need it in number plaese any body help me out

laserlight
February 8th, 2009, 01:14 PM
Which function do you have in mind?

Notsosuperhero
February 8th, 2009, 01:46 PM
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.

bidesh
February 9th, 2009, 08:04 AM
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