 <p>This expresssion </p> <pre><code>string(0) </code></pre> <p>is already invalid and results in undefined behaviour.</p> <p>The compiler considers this expression like</p> <pre><code>string( (const char * )0 ) </code></pre> <p>but null pointer may not be used in this constructor.</p> <p>The loop you wrote could work if you define one more element in the array - an empty string as for example</p> <pre><code>string mesi[] = { "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre", "" ^^^ }; printMesi(mesi); void printMesi(string v[]) { for (string* p = v; *p != ""; p++) cout &lt;&lt; (*p) &lt;&lt; "\n"; } </code></pre> <p>However first of all there is no sense to declare the array as an array of strings. It is an array of a fixed size with values that are supposed to be immutable.</p> <p>So it is better to use string literals instead of objects of type std::string.</p> <p>I would suggest to use <code>std::array</code> instead of the ordinary array. For example</p> <pre><code>#include &lt;array&gt; //... std::array&lt;const char *, 12&gt; mesi = { { "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" } }; void printMesi( const std::array&lt;const char *, 12&gt; &amp;mesi ); { for ( const char *m : mesi ) std::cout &lt;&lt; m &lt;&lt; "\n"; } printMesi( mesi ); </code></pre> <p>If your compiler does not support the class <code>std::array</code> then you can use an ordinary array declared the following way</p> <pre><code>const char * mesi[] = { "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre", 0 }; </code></pre> <p>and the function can look like</p> <pre><code>void printMesi( const char *mesi[]) { for ( const char *m = mesi; m != 0; m++ ) std::cout &lt;&lt; m &lt;&lt; "\n"; } </code></pre>