1)
char* p = "Plato";
p[4] = 'r'; // runtime error
2)
char c[6] = "Plato";
c[4] = 'i';// ok.Why no runtime here?Why is the contradiction?
cout << c << endl;
char* p = "Plato";
p[4] = 'r'; // runtime error
2)
char c[6] = "Plato";
c[4] = 'i';// ok.Why no runtime here?Why is the contradiction?
cout << c << endl;
Comment