 <p>An important thing to notice: <code>strcpy</code>'s behavior is undefined (see C99 7.23.2.3:2) when provided with <a href="http://stackoverflow.com/a/4823705/1329652">overlapping source and destination</a>. So what you're doing, no matter how the output looks, is basically not guaranteed to work unless your C implementation's documentation states otherwise.</p> <p>Use <a href="http://stackoverflow.com/a/4823705/1329652"><code>memmove</code></a> when moving data <em>within</em> a string.</p> <p>You should also be very careful in how you declare your string. The code you provided is correct:</p> <pre><code>char string[] = "foo"; </code></pre> <p>The <code>string</code> is an array of characters, initialized to contain four elements: 'f', 'o', 'o', '\0'.</p> <p>But, very similar code would be incorrect:</p> <pre><code>char * string = "foo"; </code></pre> <p>What this code does is initializes a <code>char</code> pointer to the <em>address</em> of a <strong>constant</strong> string literal "foo". A correct version would be:</p> <pre><code>const char * string = "foo"; </code></pre> <p>If you tried to modify such a string, the compiler would rightly complain.</p>