By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,336 Members | 1,048 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,336 IT Pros & Developers. It's quick & easy.

Converting character array to integer array

P: 3
How do you convert a character array into a integer array? For example:
If the character array is entered as'12' then how can get an integer array that contains the integers 1 and 2?
Apr 2 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 181
How do you convert a character array into a integer array? For example:
If the character array is entered as'12' then how can get an integer array that contains the integers 1 and 2?
Subtract ascii value of 0 to each element in character element and store in integer array.
Apr 2 '07 #2

gpraghuram
Expert 100+
P: 1,275
Hi,
If you want to convert character to integer then you can use atoi.
Do u need something else?

Thanks
Raghuram
Apr 2 '07 #3

Post your reply

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