char str[] = "asdf"; cout << str << endl; *str = "qwer"[2]; cout << str << endl; *(str+2) = "qwer"[1]; cout << str << endl;
Displays accordingly
asdf esdf eswf
Excites the place *str = "qwer"[2];
How does this design work? What type is the quoted string - to char*
or to string
?