读书人

一个cout的用法解决方案

发布时间: 2012-02-23 22:01:35 作者: rapoo

一个cout的用法
是c++ primer上的,如下:
ilist_item *it = mylist.find( 8 );

cout < < "\n "
< < "Searching for the value 8: found it < < "
< < ( it < < " yes!\n " : " no!\n " );

最下面一句话编译错误啊,大家帮看看什么问题
“ < < ( it < < " yes!\n " : " no!\n " );”

[解决办法]
对不起,上面的说错了.应该是这样:
cout < < "\n "
< < "Searching for the value 8: found it < < "
< < ( it? "yes!\n " : " no!\n ") ;

读书人网 >C++

热点推荐