I was wondering how to take an integer and store it into a char array, if anyone could tell me that would be great.
Int to char Array
Collapse
X
-
Tags: None
-
-
@OP:Originally posted by JoeMac3313Change the int into a string.
Yes, Joe is right. I'd just like to point you to the class that would be able to assist you on this. It's perhaps no surprise, but it's the java.lang.Strin g class:
Especially look at the valueOf(...) and toCharArray() methods.
Good luck.Comment
-
I don't know if I'm just not getting it, or I asked the wrong question but what I want to do is take a pre-existing character array, and store a series of integers into it.Comment
-
You have to rephrase your question a bit then: given an int, do you want to storeOriginally posted by noideanoclueI don't know if I'm just not getting it, or I asked the wrong question but what I want to do is take a pre-existing character array, and store a series of integers into it.
the individual characters of the decimal representation of that int in that array or
do you want something else to happen? A pre-existing array of chars may be too
small to hold the result ...
kind regards,
JosComment
Comment