I have this:
[code]
private static void createRandomChar
{
//LinkedList
// LinkedList
//list = random.Next(0, 26);
for (int i = 0; i < 10; i++)
{
int nextInt = random.Next(0, 26);
var let = ('a' + nextInt);
//list.AddLast(nextInt);
list1.AddLast(let);
Console.Write(list1.Last() + " ");
}
}
[/code]
But I get the error:
cannot convert from 'char' to 'System.Collections.Generic.LinkedListNode
By this line: list1.AddLast(let);
THX for helping.

VulpesRank #55 · 29.2K reputationPosted Nov 1, 2011, 3:10 PM EDT
list1.AddLast((char)let);
VulpesRank #55 · 29.2K reputationPosted Nov 1, 2011, 2:58 PM EDT
albert albertRank #2,683 · 519 reputationPosted Nov 1, 2011, 3:07 PM EDT
Error 2 Argument 1: cannot convert from 'int' to 'System.Collections.Generic.LinkedListNode
And I have it now like this:
[code]
private static void createRandomChar(LinkedList
{
//LinkedList
// LinkedList
//list = random.Next(0, 26);
for (int i = 0; i < 10; i++)
{
int nextInt = random.Next(0, 26);
var let = ('a' + nextInt);
//list.AddLast(nextInt);
list1.AddLast(let);
// list1.AddLast(let);
Console.Write(list1.Last() + " ");
}
}
[/code]
albert albertRank #2,683 · 519 reputationPosted Nov 1, 2011, 3:14 PM EDT