|
From: Per W. <pw...@ia...> - 2005-05-17 23:51:29
|
Sorry, anything working on zero-terminated strings would fail. Only code working on length-specified strings can work. And you can't just convert from char* to a std::string since that convertion knows that the c string is zero-terminated and ends early. But why do you want to print the string? Easiest to print it is to loop through the sub-strings until the \0\0 is found, but when the string is correct, there is no need to print it - just use it for the file copy. /Per W On Tue, 17 May 2005, Guillermo Gutierrez wrote: > ah of course...I was beginning to suspect as much. > > [...] > > And of course, you can not use std::cout to emit a char* or char[] that > > contains '\0' in the middle... > [...] > > would printf() be ok to emit that char*/char[] with? |