我想打印出向量中的所有字符串。当我执行以下操作时:
我希望一次打印所有元素,因为它们有很多。
(lldb) p myVector
(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >) $30 = size=65 {
[0] = Summary Unavailable
[1] = Summary Unavailable
[2] = Summary Unavailable
[3] = Summary Unavailable
[4] = Summary Unavailable
[5] = Summary Unavailable
[6] = Summary Unavailable
[7] = Summary Unavailable
[8] = Summary Unavailable
[9] = Summary Unavailable
[10] = Summary Unavailable
[11] = Summary Unavailable
...
然而,打印每个元素可以工作,例如:
p myVector[5].c_str()
(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >::value_type *) $31 = 0x0000600000210280 "-D__STDC_CONSTANT_MACROS"
我希望一次打印所有元素,因为它们有很多。