Based on the discussion "Problems sorting a string" I did my own bubblesort-function. It works fine except for the three Swedish characters "åäö" (not sure if these will be visible depending on you charset, but we have three chars which are not part of the 7-bit ascii).

These characters (and there uppercase version) are in my Linux (Ubuntu) represented by two chars each instead of one, first one char which is always the same, and then another which is of course different depending on which one it is.

I wrote a short program to output the values of these chars but I get negative values. It looks like this:

Code:
#include <stdio.h>
#include <stdlib.h>

int main()
{
  char * buf="åäöÅÄÖ";
  int x;
  //  printf("%d",ch);
  for (x=0;x<12;x=x+2)
    printf("d 1: %d 2:%d\n",x,buf[x],buf[x+1]);
  exit(0);
}
I get the values, but they are negative (-61 followed by another negative number). I thought that char's can't have negative values, so how do I get the real value, or how do I use this in my code to sort these aswell?

I don't need a complete code, just an explanation of why these are negative or how I will get the unsigned version (if they are not supposed to be negative).