here line 20 proves that βsβ is assigned to βs1β index by index but why does line 26 is not printing s1 ???
My code is submitted but i have a doubt
@anujsharmabadboy
Actually length of s1 string is unknown that why itβs not printing anything. What you can do is instead of write s1[k]=s[i], you can write s1+=s[i];
- but why is it making any difference ??
- i am assigning value index by index but still s1.length() is zero, why ??
- this is first time i have noticed it. is there something else like this in string or character array ??
- is this solution is according to the dare ??
No you just have to initialise string with some random string if you have to perform such operation.
can you explain with an example ??