我希望将一个字母的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
文件?这样可以将其保存在字符变量中。