String Handling with and without "const" key word in c++
<pre><code>#include&lt;iostream&gt;

using namespace std;

int main()
{
    const char *p="abc";
    cout&lt;&lt;p;

    return 0;
}
</code></pre>

<p>This code gives me the the desired output "abc". But when I try the below one i.e.</p>

<pre><code>#include&lt;iostream&gt;

using namespace std;

int main()
{
    char *p="abc";
    cout&lt;&lt;p;

    return 0;
}
</code></pre>

<p>it gives me a warning </p>

<pre><code>warning: deprecated conversion from string constant to ‘char*’[-Wwrite-      strings]
char *p="abc";
</code></pre>

<p>What's the reason behind this kind of scenario?</p>