0

Is there any way to work normally with strings that can conatain "\0"? For example:

std::string a("abc\0def");
std::cout << a.length();

this produces output:

3

I understand that \0 is used in C to signal the end of an array of chars, but I didn't think it would work like this in c++ as well? I haven't been able to find this explained in detail anywhere.

user1949350
  • 125
  • 3
  • 11

0 Answers0