正在使用c ++“<<”继续写入文件运营商。
离。 fp.open(文件);
fp<< endl<< “一些字符串”;
供参考,以下是gdb的跟踪:
(gdb) bt
#0 0x00000035f4489753 in memcpy () from /lib64/libc.so.6
#1 0x00000035fb09bafb in std::basic_streambuf<char, std::char_traits<char>
>::xsputn(char const*, long) () from /usr/lib64/libstdc++.so.6
#2 0x00000035fb092935 in std::basic_ostream<char, std::char_traits<char> >&
std::__ostream_insert<char, std::char_traits<char> >
(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) ()
from /usr/lib64/libstdc++.so.6
#3 0x00000035fb092baf in std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*) () from /usr/lib64/libstdc++.so.6
看起来像内存损坏?这是一些内部缓冲区溢出问题吗?