 <pre><code>int main () { char *arr= "abt"; // This could be OK on some compilers ... and give an access violation on others arr++; *arr='e'; // This is where I guess the problem is occurring. cout&lt;&lt;arr[0]; system("pause"); } </code></pre> <p>In contrast:</p> <pre><code>int main () { char arr[80]= "abt"; // This will work char *p = arr; p++; // Increments to 2nd element of "arr" *(++p)='c'; // now spells "abc" cout &lt;&lt; "arr=" &lt;&lt; arr &lt;&lt; ",p=" &lt;&lt; p &lt;&lt; "\n"; // OUTPUT: arr=abc,p=c return 0; } </code></pre> <p>This link and diagram explains "why":</p> <blockquote> <p><a href="http://www.geeksforgeeks.org/archives/14268" rel="nofollow">http://www.geeksforgeeks.org/archives/14268</a></p> <p><em>Memory Layout of C Programs</em></p> <p>A typical memory representation of C program consists of following sections.</p> <ol> <li>Text segment</li> <li>Initialized data segment</li> <li>Uninitialized data segment</li> <li>Stack</li> <li>Heap</li> </ol> <p>And a C statement like const char* string = "hello world" makes the string literal "hello world" to be stored in initialized read-only area and the character pointer variable string in initialized read-write area.</p> </blockquote>