<div dir="ltr"><div>Thanks for your explanation.</div><div><br></div><div>Best regards</div><div>Wonjun, Choi</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-14 23:36 GMT+09:00 Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Wonjun,<div><br></div><div>Negative indices is just a convenience way to get access name components from the back of the name.  The same (but a little longer) would be to write</div><div><br></div><div>x.get(x.size() - 1).toSeqNum();</div><div><br></div><div>—</div><span class="HOEnZb"><font color="#888888"><div>Alex</div></font></span><div><div class="h5"><div><br></div><div><div><blockquote type="cite"><div>On Jan 14, 2015, at 2:28 AM, 최원준 <<a href="mailto:wonjunchoi001@gmail.com" target="_blank">wonjunchoi001@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Thanks for your comment. btw, I wonder what it means.(-1 index)<div><br></div><div>Wonjun, Choi</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-14 15:57 GMT+09:00 Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">While it is possible to do what you're asking, I would actually suggest a different solution.  You can get the number stored in the name component and print it in readable form, instead of just printing the name.<br>
<br>
For example,<br>
<br>
std::cout << x.get(-1).toSeqNum();<br>
<br>
---<br>
Alex<br>
<div><div><br>
> On Jan 14, 2015, at 1:40 AM, 최원준 <<a href="mailto:wonjunchoi001@gmail.com" target="_blank">wonjunchoi001@gmail.com</a>> wrote:<br>
><br>
> Hello.<br>
><br>
> I want to change prefix name like 1, 2, 3, ... instead of /%00Z ...<br>
> The code below displays the prefix name.<br>
> ---------------------------------------------------------------<br>
> for (int i = 0; i < 300; i++) {<br>
> ndn::Name x;<br>
> x.appendSeqNum(i);<br>
> std::cout << i << " = " << x << std::endl;<br>
> }<br>
> return 0;<br>
> ---------------------------------------------------------------<br>
> how can I set the prefix like /v1/1, /v1/2, ...?<br>
><br>
> Wonjun, Choi<br>
</div></div>> _______________________________________________<br>
> ndnSIM mailing list<br>
> <a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br>
> <a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
</blockquote></div><br></div>
_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>