このコードでシンボル (250) に割り当てる ASCII 値をテストできないのはなぜですか? 私がシンボルに割り当てたものではないのに -6 をテストするのは奇妙に思えます。
#include <iostream>
using namespace std;
int main()
{
char symbol = 250; // dot symbol
int a = symbol;
cout << symbol << endl; // Outputs dot symbol
cout << a << endl; // Outputs -6
if(symbol == 250)
cout << "250 works";
if(symbol == -6)
cout << "-6 works"; // -6 test works
return 0;
}