C++
x
11
1
2
using namespace std;
3
4
int main(){
5
6
char *s="z";
7
string v="abcd";
8
cout<<v<<endl;
9
v[2]=s[1];
10
cout<<v;
11
}
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.76.0/gcc-11.1.0/include -std=gnu++2b
Start
prog.cc: In function 'int main()': prog.cc:6:13: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 6 | char *s="z"; | ^~~
abcd abd
0
Finish