Hi, Can someone tell me what is wrong?
I need to take the numbers inputted and console only the positive numbers. So I am trying to add the positive numbers into an array and negative numbers into another. But I get this error at this line `int[] splitPositiveNumbers = positiveNumbers.Split();
Here is the code.
[code]
string inputData;
do
{
inputData = Console.ReadLine();
int number = Convert.ToInt32(inputData);
int[] positiveNumbers;
int[] negativeNumbers;
if (number > 0)
{
positiveNumbers = new int[number];
}else if(number < 0)
{
negativeNumbers = new int[number];
}
} while (inputData != “x”);
int[] splitPositiveNumbers = positiveNumbers.Split();
Console.WriteLine(splitPositiveNumbers);
Console.ReadLine();