august 发表于 2007-9-1 21:27:01

一个超菜的问题

偶想问下用C++的语言怎么写一条打印出"hello world"的程序呢......................

PS:可以骂偶但别砸偶

john_he 发表于 2007-9-2 11:05:12

int main()
{
using namespace std;
cout << "Hello world." << endl;
return 0;
}

……其实我多数是用C的printf的

august 发表于 2007-9-2 11:27:54

编译没通过哦??

john_he 发表于 2007-9-2 20:24:46

……应该缺些头文件而已,#include就行了,我忘了是哪个

← 从来不用C++库的人

august 发表于 2007-9-2 22:42:40

偶知道是什么原因了,是后缀的问题,   偶用了 .c   所以一直无法通过

诸神的曙光 发表于 2007-9-6 15:02:51

#include <iostream>
int main()
{
    std::cout << "hello, world" << std::endl;
    return 0;
}

kurai 发表于 2007-9-10 20:48:30

std:: ?
Why use this?

coolpay64 发表于 2007-9-10 21:12:24

因為沒有 using namespace std;
結果全要手動加上std::
kurai懂中文便用中文把。。。遷就各位。。。

august 发表于 2007-9-11 10:12:14

ok, that&#39;s good ...........

kurai 发表于 2007-9-11 23:07:18

引用第7楼coolpay64于2007-09-10 21:12发表的:
因為沒有 using namespace std;
結果全要手動加上std::
kurai懂中文便用中文把。。。遷就各位。。。

well, what should add std if I dont use &quot;using namespace std&quot;?
btw, 不喜歡打中文. 我不會用高深英文的, Don&#39;t worry
页: [1] 2
查看完整版本: 一个超菜的问题