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.
VulpesPosted Nov 1, 2011, 7:10 PM
list1.AddLast((char)let);
albert albertPosted Nov 1, 2011, 7:14 PM
albert albertPosted Nov 1, 2011, 7:07 PM
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]
VulpesPosted Nov 1, 2011, 6:58 PM