注册 登录
编程论坛 C++教室

[求助]两行代码,不知道那里错了。

terryf50 发布于 2008-12-11 12:35, 737 次点击
一个简单的代码,不明白错误那里。
#include<iostream.h>
#include<algorithm>
using namespace std;
void main()
{
    int a[]={1,2,3,4,5,6,7,8};
    copy(a,a+8,ostream_iterator<int>(cout," "));        
}
4 回复
#2
flyingcloude2008-12-11 12:50
#include<iostream.h>-----》#include<iostream>
这样应该就行了吧
#3
terryf502008-12-11 12:55
行了,我用以前写的代码修改,忘了修改“.h”。以后都要老实亲手写下,修改还是很头痛。
#4
terryf502008-12-11 13:03
2楼谢谢了。
#5
笛神2008-12-11 16:27
多了“.h”为什么会出错的?
#include<iostream.h>
#include<algorithm>
using namespace std;
这个换成
#include<iostream.h>
#include<algorithm>
会有错吗?
1