Turning the Digits of an Integer into Array Elements

Hello. I have an integer that the user enters. I need each digit of the integer to be set as an element of an array. the integer could also be entered as an array, but I need the user not to have to enter each element and press ENTER. Any help would be appreciated greatly. Thank you!
c = a % b; c gets remainder of a/b
z = x / y; z gets quotient of a/b

Good luck!
LOL. Brilliant!

Why didn't I think of that?
Hello. I did some browsing through the C++ reference and found this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// istream::ignore example
#include <iostream>     // std::cin, std::cout
#include <cstdlib>

int main () {
  char first, last;

  std::cout << "Please, enter your first name followed by your surname: ";

  first = std::cin.get();     // get one character
  std::cin.ignore(256,' ');   // ignore until space

  last = std::cin.get();      // get one character

  std::cout << "Your initials are " << first << last << '\n';
  system ("PAUSE") ;
  return 0;
}

I am going to use this format to turn each digit to an element of an array. All I need to know is how to get the next letter after the first and so on. (line 10 only gets the first character) Thank you!
I don't understand why you can't just use cin.getline()...
Topic archived. No new replies allowed.