c++ - Convert integer to array -


I want to convert an integer into an array, so that it looks like the following:

< Pre> integer number = 123456; Int array [7]; With the result:
  array [0] = 1 array [1] = 2 ... array [6] = 6  

Perhaps the better solution is to work back:

123456% 10 = 6

123456/10 = 12345

12345% 10 = 5

12345/10 = 1234


Comments

Popular posts from this blog

Is there an open source WebSockets (JavaScript) XMPP library? -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -

iphone - How do I make a UIPickerView in a UIActionSheet -