- Cant we initialize string by taking character of other string
ex: string s3(s2[0]);
2)cant we append string as this way
int d=2;
string s(“LOL”);
s=s+d;
WANT TO CLEAR SOME DOUBTS THROUGH THIS CODE
hello @dhruv.mahajan.mait
u can intialise one string with other string but not with character .
u can only append string to another string.
so here first u need to convert d to string and then add.
nd how will i convert int to string??
use to_string function.
like->
to_string(d)
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.