예제 #1
0
        private static void Chars()
        {
            int size = 5;

            MyGenericArray <char> charArray = new MyGenericArray <char>(size);

            for (int i = 0; i < size; i++)
            {
                charArray.SetItem(i, (char)(i + 97));
            }
            for (int i = 0; i < size; i++)
            {
                Console.WriteLine(charArray.GetItem(i) + " ");
            }
        }
예제 #2
0
        private static void Ints()
        {
            int size = 5;

            MyGenericArray <int> intArray = new MyGenericArray <int>(size);

            for (int i = 0; i < size; i++)
            {
                intArray.SetItem(i, i * 5);
            }
            for (int i = 0; i < size; i++)
            {
                Console.WriteLine(intArray.GetItem(i) + " ");
            }
        }