程序中使用toascii()函数将指定的虚拟键码和键盘状态翻译为相应的字符和字符串。该函数使用由给定的键盘布局句柄表示的物理键盘布局和输入语言来翻译代码。toascii()函数将字符c的高位清零,仅保留低七位。返回转换的数值。
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
int main()
{
int a = 217;
char b;
printf("before toascii() : a value =%d(%c)\n", a, a); //换换前
b = toascii(a);
printf("after toascii(): a value =%d(%c)\n", b, b); //转换后
system("pause");
return 0;
}