我的網誌清單

2014年1月23日 星期四

C++ 轉換 Ascii

ASCII 字元表  http://zh.wikipedia.org/wiki/ASCII


//今天工作有用到的一個小技巧, 把Ascii 轉成文字做按鈕判斷

const int const CHAR_TABLE[] = {
48,
49
};

//利用轉型 表數字 轉成文字
for(int i=0;i<2;i++){
printf("%c\n", static_cast<char>(CHAR_TABLE[i]));
}

沒有留言:

張貼留言