Since characters from -128 to -1 are same as from +128 to +255, then what is the point of using unsigned char?

Viewed 303
#include <stdio.h>
#include <conio.h>
int main()
{
    char a=-128;
    while(a<=-1)
    {
        printf("%c\n",a);
        a++;
    }
    getch();
    return 0;
}

The output of the above code is same as the output of the code below

#include <stdio.h>
#include <conio.h>
int main()
{
    unsigned char a=+128;
    while(a<=+254)
    {
        printf("%c\n",a);
        a++;
    }
    getch();
    return 0;
}

Then why we use unsigned char and signed char?

5 Answers
Related