ASP.NET Hosting

"The C# compiler won't let me do it"

In the spirit of language quizes, you can try to find why the following code does not compile:

DictionaryEntry entry1 = new DictionaryEntry();
entry1.Value = 0; // OK

IDictionary dictionary = new Hashtable();
dictionary["dummy"] = "dumb";
foreach (DictionaryEntry entry2 in dictionary)
  entry2.Value = 0; // NOT OK : "The left-hand side of an assignment must be a variable, property or indexer"

4 Comments

Comments have been disabled for this content.