Why do you have unsigned char?

Asked 2 years ago, Updated 2 years ago, 118 views

When do you use unsigned char in C/C++? What's the difference from just char?

c c++ char

2022-09-21 15:56

1 Answers

There are three character types in C++.

If you use a character type to handle characters, write char.

char is also used to handle numbers It is unclear how the value will be treated, signed/ unsigned.

If you use character type to deal with numbers,

The reason why I say "at least" is This is because the C++ standard only sets the minimum range for the numeric type. Depending on your environment, it may be possible to write more than that.


2022-09-21 15:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.