我大学学的是C语言,所以研究生阶段想自学C++,毕竟他们有那么多不同。但是在使用vector的时候报warning了————
Compiling...
TextSearch.cpp
f:/workspaceforc++/容器/textsearch.cpp(12) : 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<ch
ar,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
。。。。。。
TextSearch.obj - 0 error(s), 4 warning(s)
感觉代码没什么问题啊:
#include <vector>
#include <string>
#include <iostream>
using namespace std;
int main()
{
vector<string> svec;
......
}
在网上一查,有人说是编译器的问题,VC的bug,不知道是不是。
只好在#include <vector>前加上预编译忽略此warning:
#pragma warning (disable: 4786)