Store chars input by the user in a list!

Jun 27 2009 4:55 AM
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


        }


    }


}


Answers (3)