469,304 Members | 2,018 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

Int to char Array

I was wondering how to take an integer and store it into a char array, if anyone could tell me that would be great.
Jul 20 '07 #1
4 15660
Change the int into a string.
Jul 21 '07 #2
prometheuzz
197 Expert 100+
Change the int into a string.
@OP:
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.String class:
http://java.sun.com/j2se/1.5.0/docs/...ng/String.html
Especially look at the valueOf(...) and toCharArray() methods.

Good luck.
Jul 21 '07 #3
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.
Jul 21 '07 #4
JosAH
11,448 Expert 8TB
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.
You have to rephrase your question a bit then: given an int, do you want to store
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,

Jos
Jul 21 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

35 posts views Thread by Ying Yang | last post: by
21 posts views Thread by Bret | last post: by
19 posts views Thread by gaga | last post: by
5 posts views Thread by jab3 | last post: by
13 posts views Thread by chellappa | last post: by
15 posts views Thread by Kueishiong Tu | last post: by
5 posts views Thread by Stephen Cawood | last post: by
2 posts views Thread by Michael | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.