string printing issues

I loaded a string using the format

str = "string"
for(int i = 0; i<str.end(); i++)
new_str[i] = str[i];

however when I go to print, the new string only prints the first char however it does hold all the chars from the original string. This is even the case when NULL is appended to the new string.
For example:

cout << string;
output -> "string"

cout << new_str;
output -> "s"

Last edited on
Topic archived. No new replies allowed.