打印此代码的输出? [英] print the output of this code?
本文介绍了打印此代码的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我该如何打印此输出?谢谢
how can i print the output of this?thanks
const std::vector<unum>&my_vector =agent.GetInfoState().GetPositionInfo().GetCloseTeammateToTeammate(2);</unum>
这不起作用:
this doesnt work:
std::cout<<my_vector<<std::endl;
对不起,我的写作很脏,我不知道为什么代码在这里粘贴得不好
[edit]整理好的代码块-OriginalGriff [/edit]
sorry for my dirty writing,i dont know why the code doesnt paste good here
[edit]Code blocks tidied up - OriginalGriff[/edit]
推荐答案
您应该进行循环以输出所有矢量项目.
BTWmy_vector
是什么的vector
?什么是" unum "?
You should make a loop to output all the vector items.
BTWmy_vector
is avector
of what? What is ''unum''?
如果根本没有输出,则放入向量中的结果类缺少<的定义;<操作员.
使用C ++运算符重载来创建简单的分数类 [ http://www.fredosaurus.com/notes-cpp/oop-friends/overload- io.html [ ^ ]
祝你好运!
If there is no output at all, the result class that you put into the vector is missing the definition of the << operator.
Using C++ operator overloading to make a simple fraction class[^]
http://www.fredosaurus.com/notes-cpp/oop-friends/overload-io.html[^]
Good luck!
这篇关于打印此代码的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文