CIS3355:
Business Data Structures |
Are characters stored with a sign-bit ?? Yes and no. We know: 1. All characters are stored as
numeric values This is not a problem if we look at the Standard ASCII character set (the first 127 characters):
Mostly because the sign-bit (The left-most bit) is '0'. However, when we get to the extended ASCII character set (the upper set, or those with the decimal value between 128 and 255), the situation is a little cloudier:
Notice that the left-most bit is '1', implying that the value is negative. The point to keep in mind is that the values used for ASCII characters are stored as unsigned integers. Even if we store a value as a signed integer (character, numeric byte, short, integer, long), if we attempt to print our the contents as an ASCII character, it will be printed out as an unsigned character. What are unsigned integers !!! That is our next tutorial.
|