![](/img/trans.png)
[英]Why does the following c code work in turbo c and not in devc++?
[英]Why does the following c code not work?
我正在嘗試將用戶輸入的字符轉換為其字符代碼。
int main(){
char converter;
scanf("enter a character: %c", &converter);
printf("your character code is %d", converter);
return 0;
}
這將為您提供每個字符的關鍵代碼:
#include <stdio.h>
main()
{
char converter;
printf("enter a character: ");
scanf("%c", &converter);
printf("your character code is %d", (int)converter);
return 0;
}
此外,每個對應的代碼都可以在這里找到: http : //www.expandinghead.net/keycode.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.