<div dir="ltr"><div>Sorry, this is the right code that shows &#39;the issue&#39;:</div><div><br></div><div dir="ltr">function static void insert_1( string array[], string x, int pos )<br>{<br>    string mom_arr[0];<br>    if( pos &lt; array.size() &amp;&amp; pos &gt;= 0 )<br>    {<br>        for( pos =&gt; int c; c &lt; array.size(); c++ )<br>        {<br>            mom_arr &lt;&lt; array[c];<br>        }<br>        x =&gt; array[ pos ];<br>        array.size( array.size() + 1 );<br>        for( 0 =&gt; int c; c &lt; mom_arr.size(); c++ )<br>        {<br>            mom_arr[c] =&gt; array[ c + pos + 1 ];<br>        }<br>    }<br>    else if( pos == array.size() )<br>    {<br>        array &lt;&lt; x;<br>    }<br>}<br><br>function static void insert_2( string array[], string x, int pos )<br>{<br>    string mom_arr[0];<br>    if( pos &lt; array.size()  &amp;&amp; pos &gt;= 0 )<br>    {<br>        for( pos =&gt; int c; c &lt; array.size(); c++ )<br>        {<br>            mom_arr.size( mom_arr.size() + 1 );<br>            array[c] =&gt; mom_arr[ c - pos ];<br>        }<br>        x =&gt; array[ pos ];<br>        array.size( array.size() + 1 );<br>        for( 0 =&gt; int c; c &lt; mom_arr.size(); c++ )<br>        {<br>            mom_arr[c] =&gt; array[ c + pos + 1 ];<br>        }<br>    }<br>    else if( pos == array.size() )<br>    {<br>        array &lt;&lt; x;<br>    }<br>}<br><br>[&quot;a&quot;, &quot;b&quot;, &quot;c&quot;] @=&gt; string s_1[];<br>insert_1( s_1, &quot;ONE&quot;, 1 );<br>for( 0 =&gt; int c; c &lt; s_1.size(); c++ )<br>{<br>    &lt;&lt;&lt; s_1[c] &gt;&gt;&gt;;<br>}<br>&lt;&lt;&lt; &quot;&quot; &gt;&gt;&gt;;<br>[&quot;a&quot;, &quot;b&quot;, &quot;c&quot;] @=&gt; string s_2[];<br>insert_2( s_2, &quot;ONE&quot;, 1 );<br>for( 0 =&gt; int c; c &lt; s_2.size(); c++ )<br>{<br>    &lt;&lt;&lt; s_2[c] &gt;&gt;&gt;;<br>}<br><br><br><br><br></div></div>