谢谢woodhead!我改过来了,但是如下这个程序在VC6.0中为什么会有警告呢?而在DEV-C++中运行正常呢,
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
using namespace std;
int main()
{
ifstream in("file1.dat",ios::in);
vector <string> words;
string word;
while(in>>word)
words.push_back(word);
cout<<words.size();
in.close();
return 0;
} 这个是VC的警告
---Configuration: Cpp3 - Win32 Debug--------------------
Compiling...
Cpp3.cpp
D:\新建文件夹\Cpp3.cpp(18) : 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_tra
its<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:\新建文件夹\Cpp3.cpp(18) : 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<ch
ar>,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
d:\microsoft visual studio\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
d:\microsoft visual studio\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<st
d::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
Cpp3.obj - 0 error(s), 4 warning(s)
你知道为什么会这样吗,谢谢