Is the following safe:
string s;
s += "dsgdf";
cout << s;
Is the string auto initialized with ""
or I need to do this?
Is the following safe:
string s;
s += "dsgdf";
cout << s;
Is the string auto initialized with ""
or I need to do this?
A default-constructed string is empty, yes. It's not uninitialized or in some other unsafe state.