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

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -