Re: [问题] C语言程式新手 编译器问题

楼主: angus0414 (天道云踪)   2016-05-15 10:17:49
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):
作者: LPH66 (-6.2598534e+18f)   2016-05-15 11:18:00
......为什么不要叫他直接 #include <stdio.h> ?stdafx.h 这种东西不要教给新手
作者: kwpn (ITSST)   2016-05-15 12:17:00
答非所问...
作者: james1022jk (雁)   2016-05-15 17:20:00
同一楼...

Links booklink

Contact Us: admin [ a t ] ucptt.com