depkv a écrit :
> #include <iostream>
> using namespace std;
> int main()
> {
> char* p="test";
> char* q="test";
> p[2]='z';
> cout << p[2];
> cout << p;
> }
>
> Why does cout<< p[2] prints "z"
> and cout << p prints "test"
> iam using VC++ cl compiler
> Your compiler should have complained about deprecated use (literal string are const)
