int main(){
    string s = "";
    s += 1;// if I do s = s + 1 code doesn't compile
    cout<<"Hello world"+10<<endl;
    cout<<s<<endl;
}
Why it prints d and random character. I try to think it as string is a char* then if I do str + 10 then it points to the 10 pos. I am not sure I am correct or not.
 
    
– 001 Sep 22 '22 at 14:01