I have made a new string using the existing string. Let say the initial string is
string a="sample"; and the newly created string is
string b=a; Now I have placed the null character at the second index.
b[2]='\0'; when I try to out put the b string.
The output is shown as saple.
I want to end the string after index-1.
Is this behavior normal.If it is normal how to end the string after 1st index.
Thanks..
std::stringand "C-style" string concepts.