I'm trying to read values from a console application to add them to a two-dimensional array.
Current code:
public void getUserResponses(int amount)
{
int current = 0;
string[,] userArray = new string[amount, 2]; // Array
while (current < amount)
{
Console.WriteLine("Please enter username #" + current);
string username = Console.ReadLine();
// Add username to array
current++;
}
}
As you can see in the code, I want to read the username and then add it to the array.
Example:
Read the username
string username = Console.ReadLine();
And then add the username to the array in the following format:
userArray[username][placeholder]
How could I manage this?
List<Tuple<T1, T2>>instead of a 2-dimensional array.