This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug


> and produces the wrong output: 

Thanks for your bug report. This is not a bug in gcc, but in your
code. The data() function does not return a zero-terminated string;
you need to use the c_str() function for that. If you replace all
data() calls with c_str() your code works fine. Please read a C++ book
for details.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]