#include?
<
iostream
>
#include?
<
map
>
#include?
<
iterator
>
#include?
<
vector
>
#include?
<
fstream
>
#include?
<
algorithm
>
using
?
namespace
?std;
ostream
&
?
operator
<<
(std::ostream?
&
os,?pair
<
int
,
int
>
?
&
mp)

{
????os
<<
mp.first;
????os
<<
mp.second;
????
return
?os;
}
int
?_tmain(
int
?argc,?_TCHAR
*
?argv[])

{
????map
<
int
,
int
>
?imap;
????imap.insert(make_pair(
100
,
100
));
????imap.insert(make_pair(
22
,
123
));
????copy(imap.begin(),imap.end(),ostream_iterator
<
pair
<
int
,
int
>
?
>
(cout,
"
\n
"
));
????
int
?pause;
????cin
>>
pause;
????
return
?
0
;
}
为什么这个程序老是出错,为什么编译器不能找到operator<<,今天在论坛上问了一个下午,没弄明白,特地贴到此地,请大家回答详细一点,谢谢了。
posted on 2006-12-28 19:33
WeiFeng 阅读(29)
评论(1) 编辑 收藏 收藏至365Key 所属分类:
C++学习