How to delete some values in an array using c++
<p>I have a system that read automatically the information stored on an access card of an employee in his company. These informations are stored in an array. When the card reader doesn't function, the employe have to enter his name and his Pin on the pinpad near the card reader to access the building, and the card reader will create automatically the informations to store in the array. The third first cells of the array are always filled with correct value and the rest of the cells with 0. My work is to access to this array and delete all the non-relevant zero after the third elements even though it exists a 0 before the third element, this have to be keep.</p>

<p>I have the following code:</p>

<pre><code>    #include &lt;iostream&gt;  
    #include &lt;string&gt;      
    using namespace std;  
    int main(){  
      int const Taille=5;  
      int Track2[Taille], i;      
      Track2[0]=1;  
      Track2[1]=0;  
      Track2[2]=3;  
      Track2[3]=0;  
      Track2[4]=0;      
      cout&lt;&lt;"voici le contenu du tableau: \n";  
      for(i=0;i&lt;Taille;i++){  
        if(Track2[i]!=0){  
        cout&lt;&lt;"Track2["&lt;&lt;i&lt;&lt;"]= "&lt;&lt;Track2[i]&lt;&lt;"\n";  
    }  
     }  
    return 0;  
    }  
</code></pre>

<p>When executing this I get the following result:
<strong>voici le contenu du tableau: Track2[0]= 1 Track2[2]= 3</strong> And I want to get this as result: <strong>voici le contenu du tableau: Track2[0]= 1 Track2[1]= 0 Track2[2]= 3</strong> This means that, only the values that = 0, after the tird element of my array(here Track2[2]) have to be delete from my array.
How can I do this please?
Thanks</p>
