For example, printf in c can take any number of parameters like printf("%d %d %s %s...",a,b,c,d,...) and is documented as below
printf( const char *format [, argument]... );
How can I define such functions in C#?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using the params keyword:
args will be an array with all the arguments you pass. Note that it must be the last formal argument.