设为首页
收藏本站
开启辅助访问
切换到窄版
登录
立即注册
中问网首页
我的收藏
站长博客
搜索
搜索
本版
帖子
用户
第一问答网
»
论坛
›
中问网
›
问答
›
c++初学者问题
返回列表
发新帖
c++初学者问题
[复制链接]
11
|
5
|
2009-2-9 16:47:34
|
显示全部楼层
|
阅读模式
本人初学C++
用的《C++ Primer》
现在做习题三:
编一个程序,在标准输出上打印“hello,world"
我照着书上弄的:
#include
int main()
{
std::cout <<"hello,world" << std::endl;
}
我用TC++3.1编译器
编译报错
#include
我又改为#include
为什么要这么改下才行?
改了之后 std::cout <<"hello,world" << std::endl;
还是报错
请高手指点下。
回复
使用道具
举报
千问
|
2009-2-9 16:47:34
|
显示全部楼层
TC++3.1?? C++ Primer这本书是建立在微软的VC++或者UNIX的GCC下的,TC现在都已经过时了 你没看C++ Primer的前言部分吗,那里说了有的时候相同的程序在不同的编译程序下的结果会有一点点的差别,虽然以上解答都对,但是建议还是用VC++来学习...
回复
使用道具
举报
千问
|
2009-2-9 16:47:34
|
显示全部楼层
你的程序在vc++上运行没有错...
回复
使用道具
举报
千问
|
2009-2-9 16:47:34
|
显示全部楼层
#include
using namespace std;void main(){ cout<<"hello.world"<<endl;}...
回复
使用道具
举报
千问
|
2009-2-9 16:47:34
|
显示全部楼层
第一个#include "stdafx.h" int main(int argc, char* argv[]) { printf("Hello World!\n"); return 0; }第二个#include "stdafx.h"#include
int main(int argc, c...
回复
使用道具
举报
千问
|
2009-2-9 16:47:34
|
显示全部楼层
#include
int main(){ cout <<"hello,world" << endl; return 0;}...
回复
使用道具
举报
返回列表
发新帖
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
千问
主题
0
回帖
4882万
积分
论坛元老
论坛元老, 积分 48824836, 距离下一级还需 -38824837 积分
论坛元老, 积分 48824836, 距离下一级还需 -38824837 积分
积分
48824836
加好友
发消息
回复楼主
返回列表
问答
热门排行