Reading a certain number of digits

How would I go about implementing code that only reads a certain number of digits?

For example, I want an integer to only read 5 digits

so if the user inputs 328502358023, only 32850 is read
Probably the easiest way would be to use a string for the user input, then remove any unwanted characters and then convert the string to your integer.

Topic archived. No new replies allowed.