you should change char* to char, right now numberstring is an array of pointers – josefx Jun 1 '12 at 9:10.
@kevin001 If you want to convert the char to int and a character '1' provides a ascii number that's not 1, you need to remove the offset '0' to realign it to count from 0-9.
A char in C is already a number (the character's ASCII code), no conversion required.
EDIT: As pointed out in the comment, itoa() is not a standard, so better use sprintf() approach suggested in the rivaling answer! You can use itoa() function to convert your integer value to a string.
However, I get the error cannot convert 'char*' to 'char**' in assignment. Is there any idea why?
Actually, it doesn’t convert the datatype of <char> (assuming it’s a variable), although the result of the expression will be an [code ]int[/code]. The datatype isn’t actually changed (and in fact, the math is done on C integers of various sizes)....
Then your char could be said to be 'converted'.
string[0] = (char) num; I'm working my way through a larger program to figure out what it does, but
Convert Character Array To String In Java. How to iterate over a 2D list (list of lists) in Java. Sum of all Palindrome Numbers present in a Linked list.