[ndnSIM] std::cout and Interest::GetScope

Alex Afanasyev alexander.afanasyev at ucla.edu
Sat Feb 23 06:44:01 PST 2013

Hi Aaron,

This is just the way stream output in C++ works.  GetScope returns 1-byte number (char), which is considered by std::ostream as a character, not number.

To solve the confusion, just add. static_cast<int> (...GetScope ()). and it should work as expected.


On Feb 23, 2013, at 5:51 AM, "Aaron" <aaronishere at qq.com> wrote:

> Hi, Alex
> I add
> Ptr<Node> node=m_pit->GetObject<Node>();
> std::cout<<"Node#"<<node->GetId() <<"interestheader->GetScope()"<<header->GetScope()<<std::endl; under the OnInterest function 
> but why it can't show the number? It shows like below:
> Node#0interestheader->GetScope()�
> Node#1interestheader->GetScope()�
> Node#2interestheader->GetScope()�
> .....
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

More information about the ndnSIM mailing list