boost::array<char,7> buf = {'a','b','c','d','e','f','g'};
...
...
std::cout << buf.data() + 5;
It's display: fg
How to understand it?
buf.data() + 5
Thanks
boost::array<char,7> buf = {'a','b','c','d','e','f','g'};
...
...
std::cout << buf.data() + 5;
It's display: fg
How to understand it?
buf.data() + 5
Thanks
buf.data()
seems to return a pointer to the internal array buffer in question.
From there, standard pointer arithmetic applies, and you see the 6th character onwards in the std::cout.operator<<
call.