string s;
s += arr[ i ] + " "; —> ese string me space add nahi ho rahi digits ke beech me.
But,
s = s + arr[ i ] + " "; --> ese ho rahi h. Reason ???
string s;
s += arr[ i ] + " "; —> ese string me space add nahi ho rahi digits ke beech me.
But,
s = s + arr[ i ] + " "; --> ese ho rahi h. Reason ???
in this case right side
arr[i]+" "; this is not valid
+ operator works on string only
in this case at right side
one of the operand is string hence + operator is valid
so this works