In a past tutorial we looked at variables and how to declare them. Today, we will be taking a look at modifiers. A modifier in a programming language will essentially restrict or change the variable type to only accept a subset of possible conditions.
Any modifiers used in C will appear in this standard format:
modifier variable_type = variable_value;
Size Modifiers
A size modifier will affect the size of any data type in C. The size of primitive data in C (ints, chars, etc.) depends on the word length of the microprocessor. In general, the word length of an integer is the word length of the microprocessor. Below I have listed the only two size modifiers found in the C programming language:
short -- applies only to integers long -- applies only to integers and doubles
Sign Modifiers
A sign modifier is responsible for making a data type signed or unsigned. Both of these modifiers are used to affect the range of a data type. Below I have listed the two sign modifiers used in C:
signed -- applies only to characters or integers unsigned -- applies only to characters or integers
More tutorials coming soon! Let me know how you like the tutorials by commenting below and if there is any specific topics or languages you would like covered.