471,852 Members | 923 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,852 software developers and data experts.

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 15791
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
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.