when you cast the char to an unsigned int, the char sign extends. This goes back to that twos compelement stuff and all that junk that you probably don't want to understand. If you do want to understand, you know how to get a hold of me, though :-p
here is a hack that works, hopefully someone with more C/C++ experience then me knows a more elegant solution
Code:
#include <iostream>
using namespace std;
#define MAX <?
void main(void)
{
unsigned char i = 255;
cout << (i MAX 255) << endl;
}
I'll leave it to you to see if you can figure out why it works ;-)