Data conversions with char[]'s
-
Yes christmas was good,and I left my brain in a bottle some where. How do you convert char[] into strings and char[] into numbers ( greater that 10 eg 1234). I can manager sigles chars but the brain isn't fully functioning yet and I got new year to go yet! Thanks.
-
Yes christmas was good,and I left my brain in a bottle some where. How do you convert char[] into strings and char[] into numbers ( greater that 10 eg 1234). I can manager sigles chars but the brain isn't fully functioning yet and I got new year to go yet! Thanks.
-
to convert char[] into numbers you could loop through it converting each individual char into a number. Each time you move onto the next char you just multiply the number you are creating by 10 and then add the new character to it.
Thanks, but their must be better way on carring out a 'atoi' with char arrays in .Net, and still cannot find a way to convert an array of chars which is delimitted into a string.
-
Yes christmas was good,and I left my brain in a bottle some where. How do you convert char[] into strings and char[] into numbers ( greater that 10 eg 1234). I can manager sigles chars but the brain isn't fully functioning yet and I got new year to go yet! Thanks.
int val = int.Parse(new string(myChars)); :)
Luc Pattyn
-
Thanks, but their must be better way on carring out a 'atoi' with char arrays in .Net, and still cannot find a way to convert an array of chars which is delimitted into a string.