When I wrote the following code and executed it, the compiler said
deprecated conversion from string constant to
char*
int main()
{
char *p;
p=new char[5];
p="how are you";
cout<< p;
return 0;
}
It means that I should have written const char *
.
But when we pass arguments into main
using char* argv[]
we don't write const char* argv[]
.
Why?