Sign in to follow this  

about scanf

Recommended Posts

Antheus    2409
value already is an integer, but it's range is limited to values 0-255.

Or do you mean that your input is '0', '1', '2', ....

I'd usually refer to this as single-digit number, rather than 1-byte.

Easiest way would probably be:

int x = value - '0';

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this