以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 C/C++编程思想 』  (http://bbs.xml.org.cn/list.asp?boardid=61)
----  小弟刚学,很没明白这个为什么不能输出?  帮忙看看类  (http://bbs.xml.org.cn/dispbbs.asp?boardid=61&rootid=&id=62426)


--  作者:inzagyi
--  发布时间:5/10/2008 1:34:00 AM

--  小弟刚学,很没明白这个为什么不能输出?  帮忙看看类
我是在DEV-c++下运行的
#include<iostream>
using namespace std;
int main()
{
    cout<<typeid(1).name()<<endl;
    cout<<typeid(1+100l).name()<endl;
    cout<<typeid(1+100.1).name()<<endl;
    cout<<typeid(1+100.1l).name()<<endl;
    system ("pause");
    return 0;
}
运行后:
F:\DEV-CPP\Examples\Hello\4.9.3.cpp In function `int main()':
F:\DEV-CPP\Examples\Hello\4.9.3.cpp no match for 'operator<' in 'std::operator<< [with _Traits = std::char_traits<char>](((std::basic_ostream<char, std::char_traits<char> >&)(&std::cout)), ((const std::type_info*)(&_ZTIl))->std::type_info::name()) < std::endl'
--  作者:inzagyi
--  发布时间:5/10/2008 2:10:00 AM

--  
啊。。。真晕,自己看到了,原来第二句endl;的前面用了<不是<<
    汗颜啊!
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
35.156ms