1. If you want to know if an integer
value is
negative (not 'signed' - 'signed' is a property of a type, not a property of a value!), then just write
if (mynumber < 0) {
puts ("this value is negative");
}
2. If you want to make sure that a particular
type is signed (or unsigned), then use the appropriate qualifier in the declaration:
char mychar; unsigned char myunsigned; signed char mysigned;
3. If you want to check an
integral template type argument to find out whether it is a signed or unsigned type, see solution 3
4. If you want none of the above, please be more concise: please specify in the terminology of C/C++ what you mean by the terms '
integer' or '
number'; please verify that you were using the correct term when you said '
unsigned'.