Posted By

Mardoch on 11/15/11


Tagged


Versions (?)

Call with variable arguments


 / Published in: C#
 

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

  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. }  

Report this snippet  

You need to login to post a comment.