[問題] C語言程式新手 編譯器問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
本人是程式新手 很新很新那種
目前在看板上推薦入門的洪維恩 C語言教學手冊 第4版
按照例題 把程式碼打進去 執行結果 在看書上的解釋
作者是使用dev C++來寫 但我是用Visual studio community 2015來寫
有時候執行的程式結果會不同
想問在學習過程會有差嗎?
還有 我目前學習方法正確嗎?
感覺有點打完程式碼 執行程式就算了的感覺...
餵入的資料(Input):
預期的正確結果(Expected Output):
dev c++
ch=2
the ASCII of ch is 50
錯誤結果(Wrong Output):
vs
ch=a
the ASCII of ch is 97
程式碼(Code):(請善用置底文網頁, 記得排版)
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
char ch = 'a';
printf("ch=%c \n", ch);
printf("the ASCII of ch is %d \n", ch);
system("pause");
return 0;
}
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.205.136.177
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1463200096.A.99F.html
→
05/14 13:22, , 1F
05/14 13:22, 1F
→
05/14 14:09, , 2F
05/14 14:09, 2F
→
05/14 14:20, , 3F
05/14 14:20, 3F
※ 編輯: PanYX (180.205.136.177), 05/14/2016 15:10:10
→
05/14 15:15, , 4F
05/14 15:15, 4F
→
05/14 15:16, , 5F
05/14 15:16, 5F
→
05/14 15:16, , 6F
05/14 15:16, 6F
→
05/14 15:19, , 7F
05/14 15:19, 7F
→
05/14 15:24, , 8F
05/14 15:24, 8F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):