Професионална програма
+ Нов въпрос
brandkikasd avatar brandkikasd 0 Точки

Compiler error: HashDictionary.cs, Chapter 18 Introduction to programming with c#


Please I need help compiling this code HashDictionary.cs in Chapter 18 of C# Programming. I keep getting compiler error in the last part of the code related to 

IEnumerator IEnumerable.GetEnumerator()


        return ((IEnumerable<KeyValuePair<K, V>>)this).



I am just trying to compile the code as it is in the textbook. 

Error information:

Chapter18.cs(761,5): error CS0305: Using the generic type
        'System.Collections.Generic.IEnumerator<T>' requires 1 type arguments
c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll: (Location of symbol
        related to previous error)

The full code is as follows



ModEdit: Please dont post long parts of code directly to the forum.

Структури от данни и алгоритми 17/09/2015 23:26:29
Filkolev avatar Filkolev 4485 Точки
Best Answer

Put the following using directive in your code: using System.Collections;

brandkikasd avatar brandkikasd 0 Точки

Thanks. I had using System.Collections.Generic intially.

I thought that namespace was sufficient for the code. The error is cleared. Thanks once again