C++: Extracting a digit from integer.

Schadenfroh

Elite Member
Mar 8, 2003
38,416
4
0
Is there a way to extract 5 from 12345 without having to use loop?
Yes

Use cin.get() in conjunction with cin.ignore() statements or if you are looking for nonfixed number place, you will need to use modulus.