Program which copies one string to another using pointers produces no output <p>I wrote following piece of code which copies from one string to another using pointers.</p> <pre><code>#include&lt;stdio.h&gt; int main() { char strA[80] = "A string to be used for demonstration purposes"; char strB[80]; char *ptrA; char *ptrB; ptrA = strA; ptrB = strB; puts(ptrA); while(*ptrA != '\0') { *ptrB++ = *ptrA++; } *ptrB = '\0'; puts(ptrB); // prints a new line. return 0; } </code></pre> <p>Why does <code>puts(ptrB)</code> print nothing but just a newline ? However <code>puts(ptrA)</code> prints the value of <code>strA</code>.</p>