C++:这么大段的警告信息是什么意思

来源:百度知道 编辑:UC知道 时间:2024/06/19 11:58:25
初学C++,编了这么一个程序:读入一段文本到vector对象,每个单词存储为vector中的一个元素。把vector对象中每个单词转化为大写字母。输出vector对象中转化后的元素,每八个单词为一行输出。
我的程序如下:
#include <iostream>
#include <string>
#include <vector>
#include <cctype>
using namespace std;
int main()
{
vector<string> text;
string word;
while(cin >> word)
{
for(string::size_type i=0; i!=word.size(); i++)
word[i]=toupper(word[i]);
text.push_back(word);
}
for(vector<string>::size_type i=0; i!=text.size(); i++)
{
cout <<text[i];
if(i%8==7 || i==text.size()-1)
cout << endl;
else
cout << " ";
}
return 0;
}

编译时跳出了一大段难以辨认的警告信息:
Deleting intermediate files and output files for project 'hello - Win32 Debug'.
--------------------Configuration: hello - Win32 Debug--------------------
Compiling...
hello.cpp
e:\

其实只是这一句:
identifier was truncated to '255' characters in the debug information.
就是说因为用了模板库导致标识符过长,VC就出了警告。这可以看做是VC的一个BUG。
你的程序写得挺好的,没啥。
另:GCC编译通过,没有问题。

唉,范型就这样,无视吧。

敬告不影响程序,只是提示作用。只要没有error程序能正常运行。

标准C++运行库文件I/O的警告