// signedch.cpp This program finds out wheter the leftmost
// bit of type char is a signed bit
#include <iostream>
using namespace std;

int main() {

signed char s_ch = '\xFF';
unsigned char u_ch = '\xFF';
char ch = '\xFF'; // Binary: s_ch = u_ch = ch = 11111111
int s, u, i;
s = s_ch; // from signed char to int
u = u_ch; // From unsigned char to int
i = ch; // From char to int (system dependent)
cout << "For this C++ implementation, type char has " <<
( i == s ? "a sign bit.\n" : i == u ? "no sign bit. \n" : " not been implemented correctly.\n"
);
return 0;

}
