CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C/C++ >  C语言

有几个错误大家帮改一下

楼主gsp397(火烧耳朵)2003-08-02 22:58:10 在 C/C++ / C语言 提问

#include<iterator>  
  #include<fstream>  
  #include<iostream>  
  #include<vector>  
  #include<algorithm>  
  #include<functional>  
  using   namespace   std;  
  void   main()  
  {  
  istream_iterator<int>   is_string(cin),eos;  
  ofstream   outfile("text1");  
  ostream_iterator<int>   out_string(outfile);  
  vector<int>   vec;  
  copy(is_string,eos,back_inserter(vec));  
  vector<int>::iterator   iter=vec.begin();  
  while((iter=find_if(iter,vec.end(),not1(bind2nd(modulus<int>(),2))))!=vec.end())  
  {  
  copy(iter,iter+1,outfile);  
   
  }  
  } 问题点数:20、回复次数:7Top

1 楼gsp397(火烧耳朵)回复于 2003-08-02 23:11:21 得分 0

还有这个为什么错误?  
  #include<functional>  
  #include<iostream>  
  using   namespace   std;  
  void   main()  
  {  
  plus<int>   intAdd;  
  int   i=BinaryFunc(plus<double>(),2,3);  
  cout<<i<<endl;  
  }Top

2 楼gsp397(火烧耳朵)回复于 2003-08-03 11:16:35 得分 0

 
  自己upTop

3 楼gsp397(火烧耳朵)回复于 2003-08-03 11:42:52 得分 0

再upTop

4 楼zhz44(任我行)回复于 2003-08-03 19:17:34 得分 5

老兄,你把错误提示贴出来行吗?Top

5 楼gsp397(火烧耳朵)回复于 2003-08-04 11:27:37 得分 0

第一个程序的错误提示  
   
  --------------------Configuration:   Cpp6   -   Win32   Debug--------------------  
  Compiling...  
  Cpp6.cpp  
  d:\microsoft   visual   studio\vc98\include\xutility(18)   :   error   C2675:   unary   '++'   :   'class   std::basic_ofstream<char,struct   std::char_traits<char>   >'   does   not   define   this   operator   or   a   conversion   to   a   type   acceptable   to   the   predefined   operator  
                  e:\我的程序\c++   primer'\cpp6.cpp(18)   :   see   reference   to   function   template   instantiation   'class   std::basic_ofstream<char,struct   std::char_traits<char>   >   __cdecl   std::copy(int   *,int   *,class   std::basic_ofstream<char,struct   std::char_traits<char  
  >   >)'   being   compiled  
  d:\microsoft   visual   studio\vc98\include\xutility(19)   :   error   C2100:   illegal   indirection  
                  e:\我的程序\c++   primer'\cpp6.cpp(18)   :   see   reference   to   function   template   instantiation   'class   std::basic_ofstream<char,struct   std::char_traits<char>   >   __cdecl   std::copy(int   *,int   *,class   std::basic_ofstream<char,struct   std::char_traits<char  
  >   >)'   being   compiled  
  d:\microsoft   visual   studio\vc98\include\xutility(19)   :   error   C2679:   binary   '='   :   no   operator   defined   which   takes   a   right-hand   operand   of   type   'int'   (or   there   is   no   acceptable   conversion)  
                  e:\我的程序\c++   primer'\cpp6.cpp(18)   :   see   reference   to   function   template   instantiation   'class   std::basic_ofstream<char,struct   std::char_traits<char>   >   __cdecl   std::copy(int   *,int   *,class   std::basic_ofstream<char,struct   std::char_traits<char  
  >   >)'   being   compiled  
  Error   executing   cl.exe.  
   
  Cpp6.obj   -   3   error(s),   0   warning(s)  
  第二个程序的错无提示  
  --------------------Configuration:   Cpp6   -   Win32   Debug--------------------  
  Compiling...  
  Cpp6.cpp  
  e:\我的程序\c++   primer'\cpp6.cpp(7)   :   error   C2065:   'BinaryFunc'   :   undeclared   identifier  
  Error   executing   cl.exe.  
   
  Cpp6.obj   -   1   error(s),   0   warning(s)  
  Top

6 楼chon81(当我遇上你…)回复于 2003-08-04 11:54:15 得分 6

第二个错误是找不到BinaryFunc()函数Top

7 楼zhz44(任我行)回复于 2003-08-10 11:50:10 得分 9

是操做符重载的问题。查查书吧。Top

相关问题

  • 帮忙看一下错误
  • 帮着查一下错误!
  • 只有一个错误,请帮我改一下
  • 从来没见过的错误,谁能帮我改一下
  • 链接错误,请大家帮忙改一下,谢谢!!!
  • 一个有错误的sqlite的查询语句,请帮忙改一下啦!
  • 请大家帮忙找一下错误
  • 请帮我看一下个错误
  • 未知错误,请帮忙check一下.
  • 帮忙分析一下错误。

关键词

  • c++
  • cpp
  • basic
  • template
  • ofstream
  • cpp6
  • binaryfunc
  • std
  • 错误
  • vec

得分解答快速导航

  • 帖主:gsp397
  • zhz44
  • chon81
  • zhz44

相关链接

  • C/C++ Blog
  • C/C++类图书
  • C/C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo