標題: 此文章來自奇摩知識+如有不便請留言告知
C語言 ASCII碼顯示129後的字元
發問:
int main(){ char str[100], *ptr; int i; printf("輸入ASCII(數值)欲轉字串:\n"); gets(str); ptr= strtok(str, " "); while(ptr!=NULL){ while(ptr !=NULL){ sscanf(ptr,"%d", &i); printf("字元-> %c\n",i); ... 顯示更多 int main(){ char str[100], *ptr; int i; printf("輸入ASCII(數值)欲轉字串:\n"); gets(str); ptr= strtok(str, " "); while(ptr!=NULL){ while(ptr !=NULL){ sscanf(ptr,"%d", &i); printf("字元-> %c\n",i); ptr=strtok(NULL," "); } system("PAUSE"); return 0; } 以上程式碼要如何改成能輸入129後顯示129的字元,不然129~255都只能顯示" ? " ,拜託大大幫改,我有找到system("chcp 437"); 與 system("chcp 950");,但是沒成功 更新: while(ptr !=NULL){ sscanf(ptr,"%d", &i); printf("字元-> %c\n",i); ptr=strtok(NULL," "); }
最佳解答:
#include
其他解答:
公告版位
- Feb 27 Mon 2017 08:41
C語言 ASCII碼顯示129後的字元
close
文章標籤
全站熱搜
留言列表
發表留言