Qualifiers | C-Programming | EDUshark


 QUALIFIERS

          Qualifiers qualify the meaning of data types, unsigned, signed, short and long are the 4 qualifiers available in C. The manner in which they are used as follows:

  • Signed int x, y, b;
  • Unsigned int p, q;
  • Long int num;
  • short int n;


long int is a data type as mentioned earlier and short int is same as signed int or simply int on most of the C compilers.

Signed qualifier is used where we want to work with both positive and negative values.

Unsigned qualifier can be used where we want to work with only positive values. They can be only used with char and integer data types. The available range increases in positive when we use unsigned say for example range of signed char or simply char is -128 to 127 whereas for unsigned char it is 0 to 255. Same holds for int or long int.

Apart from these, two important keywords are also used as qualifiers const and volatile.

The const qualifies is used to declare a variable as a constant for example const int x=10; declare a constant x of type int with constant value.

Comments