Hi,
I have an int variable aaa with the value 100. 100 corresponds to "d" in ASCII.
I want to assign this to a string variable abc so that abc has the value "d" and not 100.
How can I do this?
when I give the below code, I get the error error CS0029: Cannot implicitly convert type 'int' to 'string'
int aaa = 100;
string abc = bbb;
but when I do abc = bbb.ToString(), I see that abc becomes "100". But I want abc to become "d".
How can I do this?
Loading
Amit PatelPosted Sep 12, 2012, 6:35 AM
Try this
int a = 100;
string b = ((char)a).ToString();
Console.WriteLine(b);
Console.ReadKey();
Thanks