CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C/C++ >  C++ 语言

这个程序在VC6.0下运行通过,但DEV C++下有3个错,请教/

楼主boyplayee()2003-12-03 23:59:04 在 C/C++ / C++ 语言 提问

#include   <string>  
  #include   <iostream>  
  #include   <fstream>  
  #include   <vector>  
  using   namespace   std;  
  题目:  
  Create   a   program   that   opens   a   file   and   counts   the   whitespace-separated   words   in   that   file.  
  //1.3.cpp  
  #include   <string>  
  #include   <iostream>  
  #include   <fstream>  
  #include   <vector>  
  void   main()   {    
    vector<string>   words;  
      ifstream   in("1.3.cpp");  
      string   word;                    
               
      while(in>>word)  
          words.push_back(word);  
         
      for(   int   i=0;   i<words.size();   i++)  
          {//if   (words[i]=="   ")       ++m;  
      }  
        cout<<i-1   <<endl;         //我直接用总词汇减去1,觉地既是要求的答案  
  }  
   
  这个程序在VC6.0下运行通过,但DEV   C++下有3个错 问题点数:5、回复次数:2Top

1 楼CAT323(CAT323)回复于 2003-12-04 01:09:54 得分 5

晕死  
  我用VC++6.0编译   出了12个错误  
  不看了  
  第一个臭风格就是void   main()  
   
  Top

2 楼boyplayee()回复于 2003-12-04 08:37:54 得分 0

NO。我用的VC++6.0结果是34,  
  D:\C++\1.3.cpp(19)   :   warning   C4786:   'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char>   >   const   *,std::basic_string<char,std::char_traits<char>,std::allocator<char>   >,std::basic_string<char,std::char_traits<char  
  >,std::allocator<char>   >   const   &,std::basic_string<char,std::char_traits<char>,std::allocator<char>   >   const   *,int>'   :   identifier   was   truncated   to   '255'   characters   in   the   debug   information  
  D:\C++\1.3.cpp(19)   :   warning   C4786:   'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char>   >   *,std::basic_string<char,std::char_traits<char>,std::allocator<char>   >,std::basic_string<char,std::char_traits<char>,std:  
  :allocator<char>   >   &,std::basic_string<char,std::char_traits<char>,std::allocator<char>   >   *,int>'   :   identifier   was   truncated   to   '255'   characters   in   the   debug   information  
  e:\编程工具\vc98\include\vector(39)   :   warning   C4786:   'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>   >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>   >   >   >::vector<std::basic_string<  
  char,std::char_traits<char>,std::allocator<char>   >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>   >   >   >'   :   identifier   was   truncated   to   '255'   characters   in   the   debug   information  
  e:\编程工具\vc98\include\vector(60)   :   warning   C4786:   'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>   >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>   >   >   >::~vector<std::basic_string  
  <char,std::char_traits<char>,std::allocator<char>   >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>   >   >   >'   :   identifier   was   truncated   to   '255'   characters   in   the   debug   information  
  Linking...  
   
  1.3.exe   -   0   error(s),   5   warning(s)  
  Top

相关问题

  • 在VC下释放某块内存反而出错,DEV-C++下编译运行均没问题?(附代码)
  • c++程序在Dev-c++和VC++里面编译的情况
  • DEV C++
  • DEV-C++ 编译出错:(帮帮我!
  • 有错,求助VC,C++高手,------?????
  • VC中调试C的错误
  • C++? VC++? C++ Builder?
  • C -> C++ -> VC?
  • DEV C++下编译从C++程序出错
  • 一个链表问题,dev c++通过,vc却不能!

关键词

  • c++
  • vector
  • basic
  • vc
  • word
  • cpp
  • debug
  • std
  • allocator
  • warning c4786

得分解答快速导航

  • 帖主:boyplayee
  • CAT323

相关链接

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

广告也精彩

反馈

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