| | |
Array as Argument
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
public void YourMethod(int[] arrOfInts)
{
//your code goes here..
} BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Join Date: Dec 2009
Posts: 1
Reputation:
Solved Threads: 0
-1
#3 8 Days Ago
•
•
•
•
How do you pass an array of integers as an argument to a method in C#?
C# Syntax (Toggle Plain Text)
void ShowNumbers (params int[] numbers) { foreach (int x in numbers) { Console.Write (x+" "); } Console.WriteLine(); } ... int[] x = {1, 2, 3}; ShowNumbers (x); ShowNumbers (4, 5);
Last edited by niek_e; 7 Days Ago at 3:45 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
![]() |
Similar Threads
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result (PHP)
- How do I convert a vector to a String array ? (Java)
- Query On Passing a datarow array as an argument (VB.NET)
- constructor with an array as an argument (C++)
- bubble sorting in an array (C)
- Function[Array] in combination with cin>> (C++)
Other Threads in the C# Forum
- Previous Thread: How to access the C++ dll in C#
- Next Thread: Re-initializing a multidimensional array in C#
Views: 2368 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development drawing encryption enum event excel file files form format ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view webbrowser windows winforms wpf xml






