Data type modifiers and How they affect a base data type.

Q5. What are data type modifiers? How do they affect a base data type?

Ans. The keywords which, when appears before a data type, change its meaning are modifiers. These are signed, unsigned, short and long.

When the data type modifiers appear before a data type, the meaning of the data type is changed in the sense that its size is affected thereby affecting minimal range of values the data type can represent. For instance, an int is by default 2 bytes long and hence can represent values -32768 and 32767 but when modifier unsigned appears before it, its range becomes 0 to 65,535. Similarly, if the modifier long is used, the range becomes -2, 147, 483, 648 to 2, 147, 483, 647.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: