我想将字母的 ASCII 值存储到变量中,我该怎么做?
例如 :
r ASCII variable = 82
main()
{
character = "character read from a file";
variable= "r ascii"; //(in this case 82), the problem is that the letter is always variable.;
printf( "the value of %c is %d, character, variable)
}
我怎样才能做到这一点?
另外需要注意的是,我如何.txt
逐个字符地读取文件?所以它可以保存在字符变量上。