此代码可以查看是否多次输入了一个字符。数组如何得到字母q的值为113?有人可以向我解释一下吗?感谢
Boolean unquiechar(String str) { if(str.Length> 129) { 返回false; }
//creates a bool array of size 129
bool[] char_set = new bool[129];
//loops length of the string
for(int i =0;i<str.Length;i++)
{
//how does q get assigned 113 in the array?
//e is assigned 101
int val = str[i];
if(char_set[val])
{
return false;
}
char_set[val] = true;
}
return true;
}
}