Would somebody please help me out reading 30 char from the user and storing them in a generic list?
This is my code, but it won't iterate except for 11 times!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LINQ
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter 30 letters to be processed");
List<char> list = new List<char>();
for (int i = 0; i < 30; i++)
{
list.Add((char)Console.Read()); //reads the next char into the List
}
Console.Read(); //makes the console wait after the program execution
}
}
}
|