Call with variable arguments


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. static void ListArguments (params object[] arguments)  
  2. {  
  3.    foreach (object argument in arguments)  
  4.    {  
  5.       Console.WriteLine (argument);  
  6.    }  
  7. }  
  8.   
  9. public static void Main( )  
  10. {  
  11.    ListArguments ("Arguments: ", DateTime.Now, 3.14f);  
  12. }  

URL: http://megasnippets.com/source-codes/csharp/call_variable_arguments

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.