length function in c++ [duplicate]
This question already has answers here: Can a std::string contain embedded nulls? (4 answers) Closed 4 days ago. I think the output of this code should be 8 because the length function should not calculate null char ”. #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string test1 = “abcdefghi”; test1[2] […]
length function in c++ [duplicate]
This question already has answers here: Can a std::string contain embedded nulls? (4 answers) Closed 4 days ago. I think the output of this code should be 8 because the length function should not calculate null char ”. #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string test1 = “abcdefghi”; test1[2] […]