vc使用map的问题
来源:百度知道 编辑:UC知道 时间:2024/06/05 18:50:03
-------------------------------例如下面的程序-------------------
#include <iostream>
#include <string>
#include <time.h>
#include <math.h>
#include <map>
using namespace std;
int main(int argc, char *argv[])
{
map<int, int> amap;
return 0;
}
第一次编译时会弹出警告
-----------------------
谢谢了,我原以为是我写错了,因为我听说以前的stl的写法跟现在的写法不一样。
-----------------------
我的马甲是好久以前注册的^_^
不过由于是英文名,所以就想换个中文的,于是有了现在这个
在第一行加入下边的代码:
#pragma warning(disable:4786)
#include "stdafx.h"
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main(int argc, char *argv[])
{
map<int, int> amap;
getchar();
return 0;
}
我为什么没出现呢
多就多吧,程序没有问题的
vc6使用stl就是会出很多的警告
不想看到的话可以向楼上老兄说的
#pragma warning(disable:4786)
把警告关了。
或者参考《stl源码剖析》附录部分,使用SGI_STL
替换vc6的垃圾stl。
VC6对stl的支持不是很好。
换个编译器吧,2003要好很多。
另外,马甲的级数都这么高了啊。
警告太多了,我用马甲发
--------------------Configuration: class - Win32 Debug--------------------
Compiling...
class.cpp
D:\new\class.cpp(17) : warning C4786: 'std::reverse_bidirectional_iterator<std::_Tree<int,std::pair<int const ,int>,std::map<int,int,std::less<int>,std::allocator<int> >::_Kfn,std::less<int>,std::allocator<int> >::iterator,st