I am confused as to what to put as the parameter for "output();"
I need to have it display the content of the array that has been created but I am getting confused as its an array and not just a variable... I thought it should be output(value); but that and many other guesses you might say have not worked.
I was taught you put in there what variables you created in main but that did not work.
using System;
namespace Lab16
{
class Program
{
static void Main(string[] args)
{
int value;
Console.Write("How big of an Array? ");
int arraySize = int.Parse(Console.ReadLine());
int[] arr = new int[arraySize];
for (int i = 0; i <= arraySize - 1; i++)
{
Console.Write("First Value: ");
value = int.Parse(Console.ReadLine());
arr[i] = Convert.ToInt32(value);
}
output();
}
static void output(ref int value, ref Array arr, ref int arraySize)
{
foreach (int i in arr)
{
for (int v = 1; v <= arraySize; v++)
{
string number = "Number: ";
Console.WriteLine("{0}{1} {2}", number, v, i);
Console.ReadLine();
}
}
}
}
}
valueargument? Just pass the array and loop thru it to print its content!