Re: [問題] C語言程式新手 編譯器問題
VS的話改成
#include "stdafx.h"
#include<stdlib.h>
因為stdafx.h裡面就有include stdio.h了
※ 引述《PanYX (Panpeter)》之銘言:
: 開發平台(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), 來自: 114.34.141.204
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1463278671.A.538.html
推
05/15 11:18, , 1F
05/15 11:18, 1F
→
05/15 11:19, , 2F
05/15 11:19, 2F
推
05/15 12:17, , 3F
05/15 12:17, 3F
推
05/15 17:20, , 4F
05/15 17:20, 4F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):