The second part first: No, there is no way to declare a variable, and set it's value through a cin statement in one line.
The first part: Use the modulus operator (%) to remove from the left of what you want, and division to remove from the right hand side. Alternatly, you can convert it to a string, then just pick by index.
No you can't. You could do that if you'd input the number as a string, but the concept of "digits" doesn't exist for a number. it's just something we use to write numbers down.
For example, I could define a base 1234 digit system in which the number 1234 would look like this:
10
What we normally use is a base 10 digit system (which means that each digits represents a power of 10 ( for example, 352 would be 3*10^2+5*10^1+2*10^0), other commonly used systems would be base 2 (binary numbers), base 8 (octal numbers) or base 16 (hexadecimal numbers).
You see, there is no link between the number and it's representation as digits, so asking a computer what the "first" digit of 1234 is wouldn't make very much sense (well, since computers store data internally as binary numbers, the "first" digit for a computer would be an 1, because 1234 is stored as 10011010010).
So I could cast it as a string and then try to access the numbers that way? btw not looking for the code to do it, thats my job to figure out once I know if it's possible to do. Hints are greatly appreciated!
Cast? No. Convert, yes. How you do that depends on whether you're use C or C++ - in C you would use sprintf, in C++ you would use a stringstream. Or you could just use the mathematical approach that Intrexa gave you.
Um guys, as for the second question in the OP's origional post...
char Number = std::cin.get();
Or am I missing something? I agree with all of you that it wouldn't necessarily be easier but it IS possible. Even more so if you're familiar with 'streambuf' objects, but this is the beginners section.
Ah, you're probably right that the OP wanted to use the extraction operator. I just don't like words like impossible, they denote limitations that aren't there.